Commit 65f4f573 authored by Edouard Menayde's avatar Edouard Menayde

Merge branch 'doc/readme' into 'master'

Readme fixed and final format

See merge request !101
parents 500a0587 ab99b209
Pipeline #5234 passed with stages
in 4 minutes and 11 seconds
......@@ -10,8 +10,7 @@
### Getting started
- You need `git`, `clang-format` installed
- [Install](https://pre-commit.com/#install) `pre-commit` hook
- You need `git` installed
- Fork the repo
- `git clone https://forge.univ-lyon1.fr/yourusername/Corp.git`
- `cd Corp`
......
......@@ -24,78 +24,88 @@ std::ostream &operator<<(std::ostream &out, const Agent &agent) {
}
bool Agent::operator==(const Agent &agent) const {
return (Character) *this == (Character) agent &&
fighting_skill == agent.get_fighting_skill() &&
stealthness == agent.get_stealthness() &&
negociation == agent.get_negociation();
return (Character) * this == (Character)agent &&
fighting_skill == agent.get_fighting_skill() &&
stealthness == agent.get_stealthness() &&
negociation == agent.get_negociation();
}
void Agent::set_stats() {
switch (this->level) {
case 1:set_xp_max(10);
case 1:
set_xp_max(10);
this->set_wage(10);
this->set_fighting_skill(10);
this->set_destruction_ability(10);
this->set_stealthness(10);
this->set_negociation(10);
break;
case 2:set_xp_max(20);
case 2:
set_xp_max(20);
this->set_wage(15);
this->set_fighting_skill(20);
this->set_destruction_ability(20);
this->set_stealthness(15);
this->set_negociation(20);
break;
case 3:set_xp_max(40);
case 3:
set_xp_max(40);
this->set_wage(20);
this->set_fighting_skill(30);
this->set_destruction_ability(30);
this->set_stealthness(20);
this->set_negociation(30);
break;
case 4:set_xp_max(80);
case 4:
set_xp_max(80);
this->set_wage(30);
this->set_fighting_skill(40);
this->set_destruction_ability(45);
this->set_stealthness(25);
this->set_negociation(35);
break;
case 5:set_xp_max(160);
case 5:
set_xp_max(160);
this->set_wage(40);
this->set_fighting_skill(45);
this->set_destruction_ability(50);
this->set_stealthness(30);
this->set_negociation(40);
break;
case 6:set_xp_max(320);
case 6:
set_xp_max(320);
this->set_wage(50);
this->set_fighting_skill(50);
this->set_destruction_ability(55);
this->set_stealthness(35);
this->set_negociation(45);
break;
case 7:set_xp_max(640);
case 7:
set_xp_max(640);
this->set_wage(70);
this->set_fighting_skill(55);
this->set_destruction_ability(60);
this->set_stealthness(40);
this->set_negociation(50);
break;
case 8:set_xp_max(1280);
case 8:
set_xp_max(1280);
this->set_wage(90);
this->set_fighting_skill(60);
this->set_destruction_ability(65);
this->set_stealthness(45);
this->set_negociation(55);
break;
case 9:set_xp_max(2600);
case 9:
set_xp_max(2600);
this->set_wage(120);
this->set_fighting_skill(65);
this->set_destruction_ability(70);
this->set_stealthness(50);
this->set_negociation(60);
break;
case 10:set_xp(0);
case 10:
set_xp(0);
set_xp_max(0);
this->set_wage(150);
this->set_fighting_skill(75);
......@@ -103,7 +113,8 @@ void Agent::set_stats() {
this->set_stealthness(60);
this->set_negociation(75);
break;
default:set_level(1);
default:
set_level(1);
break;
}
}
......@@ -117,7 +128,8 @@ void Agent::level_update() {
}
}
unsigned int Agent::get_power() const {
return get_stealthness() + get_negociation() + get_fighting_skill() + get_destruction_ability();
return get_stealthness() + get_negociation() + get_fighting_skill() +
get_destruction_ability();
}
} // namespace characters
} // namespace core
......@@ -31,7 +31,6 @@ class Agent : public Character {
unsigned int negociation = 10;
public:
/**
* Modifie les Caractéristiques de l'agent en fonction de son niveau.
*/
......@@ -42,7 +41,7 @@ class Agent : public Character {
*/
void level_update();
template<class Archive>
template <class Archive>
void serialize(Archive &ar) {
CEREAL_OPTIONAL_NVP(ar, name);
CEREAL_OPTIONAL_NVP(ar, surname);
......
......@@ -16,7 +16,6 @@ void Character::set_description(const string &description) {
unsigned int Character::get_level() const { return level; }
void Character::set_level(unsigned int level) { Character::level = level; }
unsigned int Character::get_xp() const { return xp; }
void Character::set_xp(unsigned int xp) { Character::xp = xp; }
unsigned int Character::get_xp_max() const { return xp_max; }
......@@ -51,8 +50,8 @@ void Character::set_destruction_ability(unsigned int destruction_ability) {
bool Character::operator==(const Character &character) const {
return name == character.get_name() && surname == character.get_surname() &&
description == character.get_description() &&
level == character.get_level() &&
xp == character.get_xp() && wage == character.get_wage() &&
level == character.get_level() && xp == character.get_xp() &&
wage == character.get_wage() &&
destruction_ability == character.get_destruction_ability();
}
......
......@@ -38,9 +38,9 @@ class Character {
*/
unsigned int level = 1;
/**
* Expérience acquise par le personnage, initialisée à 0.
*/
/**
* Expérience acquise par le personnage, initialisée à 0.
*/
unsigned int xp = 0;
/**
......@@ -49,7 +49,8 @@ class Character {
unsigned int xp_max = 10;
/**
* Booléen définissant si le personnage est disponible pour une mission ou non, initialisée à Vrai.
* Booléen définissant si le personnage est disponible pour une mission ou
* non, initialisée à Vrai.
*/
bool available = true;
......
......@@ -20,76 +20,86 @@ std::ostream &operator<<(std::ostream &out, const Hero &hero) {
}
bool Hero::operator==(const Hero &hero) const {
return (Character) *this == (Character) hero && agility == hero.agility &&
charisma == hero.charisma && ingenuity == hero.ingenuity;
return (Character) * this == (Character)hero && agility == hero.agility &&
charisma == hero.charisma && ingenuity == hero.ingenuity;
}
void Hero::set_stats() {
switch (this->level) {
case 1:set_xp_max(10);
case 1:
set_xp_max(10);
this->set_wage(10);
this->set_agility(10);
this->set_destruction_ability(10);
this->set_ingenuity(10);
this->set_charisma(10);
break;
case 2:set_xp_max(20);
case 2:
set_xp_max(20);
this->set_wage(15);
this->set_agility(20);
this->set_destruction_ability(20);
this->set_ingenuity(15);
this->set_charisma(20);
break;
case 3:set_xp_max(40);
case 3:
set_xp_max(40);
this->set_wage(20);
this->set_agility(30);
this->set_destruction_ability(30);
this->set_ingenuity(20);
this->set_charisma(30);
break;
case 4:set_xp_max(80);
case 4:
set_xp_max(80);
this->set_wage(30);
this->set_agility(40);
this->set_destruction_ability(45);
this->set_ingenuity(25);
this->set_charisma(35);
break;
case 5:set_xp_max(160);
case 5:
set_xp_max(160);
this->set_wage(40);
this->set_agility(45);
this->set_destruction_ability(50);
this->set_ingenuity(30);
this->set_charisma(40);
break;
case 6:set_xp_max(320);
case 6:
set_xp_max(320);
this->set_wage(50);
this->set_agility(50);
this->set_destruction_ability(55);
this->set_ingenuity(35);
this->set_charisma(45);
break;
case 7:set_xp_max(640);
case 7:
set_xp_max(640);
this->set_wage(70);
this->set_agility(55);
this->set_destruction_ability(60);
this->set_ingenuity(40);
this->set_charisma(50);
break;
case 8:set_xp_max(1280);
case 8:
set_xp_max(1280);
this->set_wage(90);
this->set_agility(60);
this->set_destruction_ability(65);
this->set_ingenuity(45);
this->set_charisma(55);
break;
case 9:set_xp_max(2600);
case 9:
set_xp_max(2600);
this->set_wage(120);
this->set_agility(65);
this->set_destruction_ability(70);
this->set_ingenuity(50);
this->set_charisma(60);
break;
case 10:set_xp(0);
case 10:
set_xp(0);
set_xp_max(0);
this->set_wage(150);
this->set_agility(75);
......@@ -97,7 +107,8 @@ void Hero::set_stats() {
this->set_ingenuity(60);
this->set_charisma(75);
break;
default:set_level(1);
default:
set_level(1);
break;
}
}
......@@ -111,7 +122,8 @@ void Hero::level_update() {
}
}
unsigned int Hero::get_power() const {
return get_agility() + get_agility() + get_charisma() + get_destruction_ability();
return get_agility() + get_agility() + get_charisma() +
get_destruction_ability();
}
} // namespace characters
} // namespace core
......@@ -9,5 +9,5 @@ namespace characters {
* Stocke soit un héros soit un agent.
*/
typedef variant<Hero, Agent> character;
}
} // namespace characters
} // namespace core
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment