From d9ba9b4ffd515cdc8661626efcc342a6535807e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Magnenat?= Date: Wed, 9 Oct 2024 11:06:45 +0200 Subject: [PATCH] Applied Quipyowert2's comments. --- libgag/src/StringTable.cpp | 12 +++++------ src/AICastor.cpp | 4 ++-- src/AIEcho.h | 22 ++++++++++----------- src/AINicowar.cpp | 34 ++++++++++++++++---------------- src/AINicowar.h | 24 +++++++++++----------- src/AINumbi.cpp | 6 +++--- src/Building.cpp | 19 +++++++++--------- src/Building.h | 18 ++++++++--------- src/Minimap.cpp | 30 ++++++++++++++-------------- src/NetMessage.cpp | 9 ++------- src/NetMessage.h | 24 ---------------------- src/SGSL.cpp | 10 +++++----- src/SGSL.h | 2 +- src/YOGClientPlayerListManager.h | 4 ++-- src/YOGServerPlayer.cpp | 2 +- 15 files changed, 96 insertions(+), 124 deletions(-) diff --git a/libgag/src/StringTable.cpp b/libgag/src/StringTable.cpp index 79995f94..231964cb 100644 --- a/libgag/src/StringTable.cpp +++ b/libgag/src/StringTable.cpp @@ -179,14 +179,14 @@ namespace GAGCore for (std::map::iterator it=stringAccess.begin(); it!=stringAccess.end(); ++it) { // For each entry... - bool lCwp=false; + bool lastCharWasPct=false; int baseCount=0; const std::string &s = it->first; // we check that we only have valid format (from a FormattableString point of view)... for (size_t j=0; jsecond]->data.size(); i++) { const std::string &s = strings[it->second]->data[i]; - bool lCwp=false; + bool lastCharWasPct=false; int count=0; for (size_t j=0; jmyUnits; int sumCanSwim=0; int sumCantSwim=0; @@ -2986,7 +2986,7 @@ void AICastor::computeResourcesCluster() void AICastor::updateGlobalGradientNoObstacle(Uint8 *gradient) { - //In this algorithm, "l" stands for one case at Left, "r" for one case at Right, "u" for Up, and "d" for Down. + //In this algorithm, "l" stands for one tile at Left, "r" for one tile at Right, "u" for Up, and "d" for Down. // Warning, this is *nearly* a copy-past, 4 times, once for each direction. int w=map->w; int h=map->h; diff --git a/src/AIEcho.h b/src/AIEcho.h index 2f65f8ed..2301a0fe 100644 --- a/src/AIEcho.h +++ b/src/AIEcho.h @@ -346,9 +346,9 @@ namespace AIEcho bool load(GAGCore::InputStream *stream, Player *player, Sint32 versionMinor); void save(GAGCore::OutputStream *stream); - ///Returns true if the provided position matches any of the sources that where added + ///Returns true if the provided position matches any of the sources that were added bool match_source(Map* map, int posX, int posY); - ///Returns true if the provided position matches any of the obstacles that where added + ///Returns true if the provided position matches any of the obstacles that were added bool match_obstacle(Map* map, int posX, int posY); ///Returns true if this GradientInfo has any entities that can change, causing it to need to be updated. ///This is an optimization, as many gradients don't need to be update @@ -372,7 +372,7 @@ namespace AIEcho ///A generic, all purpose gradient. The gradient is referenced by its GradientInfo, which it uses continually in its computation. ///Echo gradients are probably the slowest gradients in the game. However, they have one key difference compared to other gradients, - ///they can be shared, and they are generic, even more so than Nicowar gradients (which where decently generic, but not entirely). + ///they can be shared, and they are generic, even more so than Nicowar gradients (which were decently generic, but not entirely). class Gradient { public: @@ -396,7 +396,7 @@ namespace AIEcho ///The gradient manager is a very important part of the system, just like the gradient itself is. The gradient manager takes upon the task ///of managing and updating various gradients in the game. It returns a matching gradient when provided a GradientInfo. ///This object is shared among all Echo AI's, which means gradients that aren't specific to a particular team (such as most Resource - ///gradients) don't have to be recalculated for every Echo AI separately. This saves allot of cpu time when their are multiple Echo AI's. + ///gradients) don't have to be recalculated for every Echo AI separately. This saves a lot of cpu time when their are multiple Echo AI's. class GradientManager { public: @@ -563,7 +563,7 @@ namespace AIEcho }; - ///This constraint, against unlike the others, does not use gradients. It only allows the given + ///This constraint, again unlike the others, does not use gradients. It only allows the given ///position to be allowed. The resulting building will *not* be centered on it except if it is ///a 1x1 building class SinglePosition : public Constraint @@ -633,7 +633,7 @@ namespace AIEcho ///The building register is a very important sub system of Echo. It keeps track of buildings. ///A seemingly simple process, but very, very important. Buildings you construct are looked for, - ///found, recorded, etc. Allot of seemingly odd code is found here, meant to work around some + ///found, recorded, etc. A lot of seemingly odd code is found here, meant to work around some ///of the difficulties of other parts of glob2, so that the AI programmer can have a seamless, ///comfortable interface. Nothing here is directly important to an AI programmer. ///The system puts buildings through three stages. The first is where the building order has been @@ -728,7 +728,7 @@ namespace AIEcho ///These are all conditions on a particular Building. They are used in several places, such as when counting numbers of buildings, or ///for setting a condition on an order to change the number of units assigned, making them very useful. Its important to note that - ///none of the conditions work on enemies buildings, they only work on buildings on you're own team. + ///none of the conditions work on enemies buildings, they only work on buildings on your own team. namespace Conditions { ///This is used for loading and saving purposes only @@ -952,7 +952,7 @@ namespace AIEcho }; ///Similar to BeingUpgraded, but this also takes a level, in which the building is being upgraded - ///to a particular level. When possible, use this instead od combining BeingUpgraded and BuildingLevel + ///to a particular level. When possible, use this instead of combining BeingUpgraded and BuildingLevel class BeingUpgradedTo : public BuildingCondition { public: @@ -1122,7 +1122,7 @@ namespace AIEcho ///checks for the conditions for the management order to execute at all. indeterminate means ///that its impossible to execute, false means wait some more and true means ready to execute ///For example, the ChangeFlagSize order requires that the building be in existence, and - ///that its a flag. + ///that it's a flag. virtual boost::logic::tribool wait(Echo& echo)=0; virtual bool load(GAGCore::InputStream *stream, Player *player, Sint32 versionMinor); @@ -1190,9 +1190,9 @@ namespace AIEcho }; - ///A resource tracker is generally used for management, like most other things. A resource trackers job is to keep + ///A resource tracker is generally used for management, like most other things. A resource tracker's job is to keep ///track of the number of resources in a particular building, and returning averages over a small period of time. - ///Its better to use a resource tracker than getting the resource amounts directly, because a resource tracker + ///It's better to use a resource tracker than getting the resource amounts directly, because a resource tracker ///returns trends, and small anomalies like an Inn running out of food for only a second don't impact its result greatly. class ResourceTracker { diff --git a/src/AINicowar.cpp b/src/AINicowar.cpp index 766841bf..63355706 100644 --- a/src/AINicowar.cpp +++ b/src/AINicowar.cpp @@ -567,9 +567,9 @@ void NewNicowar::check_phases(Echo& echo) } ///Qualifications for the upgrading phase 1: - ///1) Atleast strategy.upgrading_phase_1_school_min schools - ///2) Atleast strategy.upgrading_phase_1_unit_min units - ///3) Atleast strategy.upgrading_phase_1_trained_worker_min of them are trained for upgrading to level 2 + ///1) At least strategy.upgrading_phase_1_school_min schools + ///2) At least strategy.upgrading_phase_1_unit_min units + ///3) At least strategy.upgrading_phase_1_trained_worker_min of them are trained for upgrading to level 2 BuildingSearch schools(echo); schools.add_condition(new SpecificBuildingType(IntBuildingType::SCIENCE_BUILDING)); schools.add_condition(new NotUnderConstruction); @@ -586,9 +586,9 @@ void NewNicowar::check_phases(Echo& echo) } ///Qualifications for the upgrading phase 2: - ///1) Atleast strategy.upgrading_phase_2_school_min level 2 or level 3 schools - ///2) Atleast strategy.upgrading_phase_2_unit_min units - ///3) Atleast strategy.upgrading_phase_2_trained_worker_min of them are trained for upgrading to level 3 + ///1) At least strategy.upgrading_phase_2_school_min level 2 or level 3 schools + ///2) At least strategy.upgrading_phase_2_unit_min units + ///3) At least strategy.upgrading_phase_2_trained_worker_min of them are trained for upgrading to level 3 BuildingSearch schools_2(echo); schools_2.add_condition(new SpecificBuildingType(IntBuildingType::SCIENCE_BUILDING)); schools_2.add_condition(new NotUnderConstruction); @@ -609,8 +609,8 @@ void NewNicowar::check_phases(Echo& echo) upgrading_phase_2=false; } - ///Qualifications for the war preperation phase: - ///1) Atleast strategy.war_preparation_phase_unit_min units + ///Qualifications for the war preparation phase: + ///1) At least strategy.war_preparation_phase_unit_min units ///2) Less than strategy.war_preparation_phase_barracks_max barracks OR ///3) Less than strategy.war_preparation_phase_trained_warrior_max trained warriors BuildingSearch barracks(echo); @@ -633,7 +633,7 @@ void NewNicowar::check_phases(Echo& echo) } ///Qualifications for the war phase: - ///Atleast strategy.war_phase_trained_warrior_min trained warriors + ///At least strategy.war_phase_trained_warrior_min trained warriors if(warrior_count >= strategy.war_phase_trained_warrior_min) { war=true; @@ -644,7 +644,7 @@ void NewNicowar::check_phases(Echo& echo) } ///Qualifications for the fruit phase: - ///Atleast strategy.fruit_phase_unit_min units, and fruits on the map + ///At least strategy.fruit_phase_unit_min units, and fruits on the map if(echo.is_fruit_on_map() && stat->totalUnit >= strategy.fruit_phase_unit_min) { fruit_phase=true; @@ -656,7 +656,7 @@ void NewNicowar::check_phases(Echo& echo) ///Qualifications for the starving recovery phase: ///1) More than strategy.starvation_recovery_phase_starving_no_inn_min_percent % units hungry but not able to eat - ///2) Atleast one unit (because of division by 0) + ///2) At least one unit (because of division by 0) if(stat->totalUnit > 1) { int total_starving_percent = stat->needFoodNoInns * 100 / stat->totalUnit; @@ -677,7 +677,7 @@ void NewNicowar::check_phases(Echo& echo) ///Qualifications for the no worker phase: ///1) More than strategy.no_workers_phase_free_worker_minimum_percent % workers free ///2) No needed jobs - ///3) Atleast one worker (because of division by 0) + ///3) At least one worker (because of division by 0) if(stat->numberUnitPerType[WORKER] > 0) { const int workers_free = (stat->isFree[WORKER] - stat->totalNeeded) * 100 / stat->numberUnitPerType[WORKER]; @@ -696,7 +696,7 @@ void NewNicowar::check_phases(Echo& echo) } ///Qualifications for the can swim phase: - ///1) Atleast one worker that can swim + ///1) At least one worker that can swim int total_can_swim=0; for(int i=0; i<4; ++i) total_can_swim += stat->upgradeStatePerType[WORKER][SWIM][i]; @@ -1060,7 +1060,7 @@ int NewNicowar::order_regular_inn(Echo& echo) //You dont want to be too close to water, so that farm can develop between it and water bo->add_constraint(new AIEcho::Construction::MinimumDistance(gi_water, 6)); - //Constraints arround nearby settlement + //Constraints around nearby settlement AIEcho::Gradients::GradientInfo gi_building; gi_building.add_source(new AIEcho::Gradients::Entities::AnyTeamBuilding(echo.player->team->teamNumber, false)); gi_building.add_obstacle(new AIEcho::Gradients::Entities::AnyResource); @@ -1126,7 +1126,7 @@ int NewNicowar::order_regular_swarm(Echo& echo) //Constraints about the distance to water. AIEcho::Gradients::GradientInfo gi_water; gi_water.add_source(new AIEcho::Gradients::Entities::Water); - //You dont want to be too close to water, so that farm can develop between it and water + //You don't want to be too close to water, so that farm can develop between it and water bo->add_constraint(new AIEcho::Construction::MinimumDistance(gi_water, 6)); //Constraints around nearby settlement @@ -1218,7 +1218,7 @@ int NewNicowar::order_regular_racetrack(Echo& echo) int NewNicowar::order_regular_swimmingpool(Echo& echo) { - //The main order for the swimmingpool + //The main order for the swimming pool BuildingOrder* bo = new BuildingOrder(IntBuildingType::SWIMSPEED_BUILDING, 6); //Constraints around the location of wood @@ -1527,7 +1527,7 @@ void NewNicowar::manage_swarm(Echo& echo, int id) else explorer_ratio=0; - ///Warriors are constructed during the war preperation phase + ///Warriors are constructed during the war preparation phase if(war_preparation) { warrior_ratio=strategy.war_preparation_swarm_warrior_ratio; diff --git a/src/AINicowar.h b/src/AINicowar.h index dd861eed..fd3f5fe9 100644 --- a/src/AINicowar.h +++ b/src/AINicowar.h @@ -151,29 +151,29 @@ class NicowarStrategy : LoadableFromConfigFile int upgrading_phase_1_inn_chance; ///The random chance that, when selecting the type of level 1 building to upgrade, it will choose an hospital int upgrading_phase_1_hospital_chance; - ///The random chance that, when selecting the type of level 1 building to upgrade, it will choose an racetrack + ///The random chance that, when selecting the type of level 1 building to upgrade, it will choose a racetrack int upgrading_phase_1_racetrack_chance; - ///The random chance that, when selecting the type of level 1 building to upgrade, it will choose an swimming pool + ///The random chance that, when selecting the type of level 1 building to upgrade, it will choose a swimming pool int upgrading_phase_1_swimmingpool_chance; - ///The random chance that, when selecting the type of level 1 building to upgrade, it will choose an barracks + ///The random chance that, when selecting the type of level 1 building to upgrade, it will choose a barracks int upgrading_phase_1_barracks_chance; - ///The random chance that, when selecting the type of level 1 building to upgrade, it will choose an school + ///The random chance that, when selecting the type of level 1 building to upgrade, it will choose a school int upgrading_phase_1_school_chance; - ///The random chance that, when selecting the type of level 1 building to upgrade, it will choose an tower + ///The random chance that, when selecting the type of level 1 building to upgrade, it will choose a tower int upgrading_phase_1_tower_chance; ///The random chance that, when selecting the type of level 2 building to upgrade, it will choose an inn int upgrading_phase_2_inn_chance; ///The random chance that, when selecting the type of level 2 building to upgrade, it will choose an hospital int upgrading_phase_2_hospital_chance; - ///The random chance that, when selecting the type of level 2 building to upgrade, it will choose an racetrack + ///The random chance that, when selecting the type of level 2 building to upgrade, it will choose a racetrack int upgrading_phase_2_racetrack_chance; - ///The random chance that, when selecting the type of level 2 building to upgrade, it will choose an swimming pool + ///The random chance that, when selecting the type of level 2 building to upgrade, it will choose a swimming pool int upgrading_phase_2_swimmingpool_chance; - ///The random chance that, when selecting the type of level 2 building to upgrade, it will choose an barracks + ///The random chance that, when selecting the type of level 2 building to upgrade, it will choose a barracks int upgrading_phase_2_barracks_chance; - ///The random chance that, when selecting the type of level 2 building to upgrade, it will choose an school + ///The random chance that, when selecting the type of level 2 building to upgrade, it will choose a school int upgrading_phase_2_school_chance; - ///The random chance that, when selecting the type of level 2 building to upgrade, it will choose an tower + ///The random chance that, when selecting the type of level 2 building to upgrade, it will choose a tower int upgrading_phase_2_tower_chance; ///The number of units to assign to an upgrade for upgrading phase level 1 int upgrading_phase_1_units_assigned; @@ -274,7 +274,7 @@ class NewNicowar : public AIEcho::EchoAI bool defend_explorers; ///During this phase, Nicowar tries to construct many explorers so that it can launch an attack with them bool explorer_attack_preparation_phase; - ///During this phase, Nicowar will activity attack its opponents with explorers + ///During this phase, Nicowar will actively attack its opponents with explorers bool explorer_attack_phase; @@ -300,7 +300,7 @@ class NewNicowar : public AIEcho::EchoAI ///This counts how many StarvingRecoveryInn's there are under construction int starving_recovery_inns; - ///This function starts construction on buildings that are queued for construction. Its careful + ///This function starts construction on buildings that are queued for construction. It's careful ///not to construct too much or too little at once void order_buildings(AIEcho::Echo& echo); ///This function starts construction of a RegularInn, and returns the ID code diff --git a/src/AINumbi.cpp b/src/AINumbi.cpp index d47b10e8..7e73b74e 100644 --- a/src/AINumbi.cpp +++ b/src/AINumbi.cpp @@ -410,14 +410,14 @@ boost::shared_ptrAINumbi::swarmsForWorkers(const int minSwarmNumbers, con int f=estimateFood(b); int numberRequestedTemp=numberRequested; - int numberRequestedLocA=b->maxUnitWorking; + int numberRequestedLocal=b->maxUnitWorking; if (f<(nbu*3-1)) numberRequestedTemp=0; - else if (numberRequestedLocA==0) + else if (numberRequestedLocal==0) if (f<(nbu*5+1)) numberRequestedTemp=0; - if (numberRequestedLocA!=numberRequestedTemp) + if (numberRequestedLocal!=numberRequestedTemp) { //printf("AI: (%d) numberRequested changed to (nrt=%d) (nrl=%d)(f=%d) (nbu=%d).\n", b->UID, numberRequestedTemp, numberRequestedLoca, f, nbu); b->maxUnitWorkingLocal=numberRequestedTemp; diff --git a/src/Building.cpp b/src/Building.cpp index 68086354..f5bb0847 100644 --- a/src/Building.cpp +++ b/src/Building.cpp @@ -1395,19 +1395,19 @@ bool Building::isHardSpaceForBuildingSite(void) bool Building::isHardSpaceForBuildingSite(ConstructionResultState constructionResultState) { - int tlTn=-1; + int futureBuildingTypeId=-1; if (constructionResultState==UPGRADE) - tlTn=type->nextLevel; + futureBuildingTypeId=type->nextLevel; else if (constructionResultState==REPAIR) - tlTn=type->prevLevel; + futureBuildingTypeId=type->prevLevel; else assert(false); - if (tlTn==-1) + if (futureBuildingTypeId==-1) return true; - BuildingType *bt=globalContainer->buildingsTypes.get(tlTn); - int x=posX+bt->decLeft-type->decLeft; - int y=posY+bt->decTop -type->decTop ; + BuildingType *bt=globalContainer->buildingsTypes.get(futureBuildingTypeId); + int x=posX + bt->decLeft - type->decLeft; + int y=posY + bt->decTop - type->decTop ; int w=bt->width; int h=bt->height; @@ -1485,8 +1485,8 @@ bool Building::subscribeToBringResourcesStep() 1-the closest the unit is, the better it is. 2-the less the unit is hungry, the better it is. 3-if the unit has a needed resource, this is better. - 4-if the unit as a not needed resource, this is worse. - 5-if the unit is close of a needed resource, this is better + 4-if the unit has a not-needed resource, this is worse. + 5-if the unit is close to a needed resource, this is better. score_to_max=(rightRes*100/d+noRes*80/(d+dr)+wrongRes*25/(d+dr))/walk+sign(timeLeft>>2 - (d+dr))*500+100/harvest */ @@ -2531,6 +2531,7 @@ void Building::addResourceIntoBuilding(int resourceType) int totResources=0; for (unsigned i=0; imaxResource[i]; + assert(totResources>0); hp += type->hpMax/totResources; hp = std::min(hp, type->hpMax); } diff --git a/src/Building.h b/src/Building.h index 98d65b0e..56d4dc1d 100644 --- a/src/Building.h +++ b/src/Building.h @@ -170,27 +170,27 @@ private:bool fullInside(void); int desiredNumberOfWorkers(void); ///This is called every step. The building updates the desiredMaxUnitWorking variable using - ///the function desiredNumberOfWorkers + ///the function desiredNumberOfWorkers. public:void step(void); - ///This function subscribes any building that needs resources carried to it with units. - ///It is considered greedy, hiring as many units as it needs in order of its preference + ///This function subscribes any building that needs resources carried to it by units. + ///It is considered greedy, hiring as many units as it needs in the order of its preference. ///Returns true if a unit was hired bool subscribeToBringResourcesStep(void); - ///This function subscribes any flag that needs units for a with units. - ///It is considered greedy, hiring as many units as it needs in order of its preference + ///This function subscribes any flag that needs units. + ///It is considered greedy, hiring as many units as it needs in the order of its preference. ///Returns true if a unit was hired bool subscribeForFlagingStep(); /// Subscribes a unit to go inside the building. void subscribeUnitForInside(Unit* unit); - /// This is a step for swarms. Swarms heal themselves and create new units + /// This is a step for swarms. Swarms heal themselves and create new units. void swarmStep(void); - /// This function searches for enemies, computes the best target, and fires a bullet + /// This function searches for enemies, computes the best target, and fires a bullet. void turretStep(Uint32 stepCounter); /// This step updates clearing flag gradients. When there are no more resources remaining, units are to - /// be fired. When resources grow back, units have to be rehired.= + /// be fired. When resources grow back, units have to be rehired. void clearingFlagStep(); /// Kills the building, removing all units that are working or inside the building, - /// changing the state and adding it to the list of buildings to be deleted + /// changing the state and adding it to the list of buildings to be deleted. void kill(void); /// Tells whether a particular unit can work at this building. Takes into account this buildings level, diff --git a/src/Minimap.cpp b/src/Minimap.cpp index 3469a78b..740252ba 100644 --- a/src/Minimap.cpp +++ b/src/Minimap.cpp @@ -296,7 +296,7 @@ void Minimap::computeColors(int row, int localTeam) { (220*3)/5, (25*3)/5, (30*3)/5 }, // enemy FOW }; - int pPol[3+MAX_RESOURCES]; + int pCol[3+MAX_RESOURCES]; // get data int szX = mini_w; @@ -315,7 +315,7 @@ void Minimap::computeColors(int row, int localTeam) const int dy = row; for (int dx=0; dxmap.isMapDiscovered(miniDx, miniDy, visibleTeams)) { // get color to add - int pPolIndex; + int pColIndex; const auto& r = game->map.getResource(miniDx, miniDy); if (r.type!=NO_RES_TYPE) { - pPolIndex=r.type + 3; + pColIndex=r.type + 3; } else { - pPolIndex=game->map.getUMTerrain(miniDx,miniDy); + pColIndex=game->map.getUMTerrain(miniDx,miniDy); } // get weight to add - int pPolAddValue; + int pColAddValue; if (useMapDiscovered || game->map.isFOWDiscovered(miniDx, miniDy, visibleTeams)) - pPolAddValue=5; + pColAddValue=5; else - pPolAddValue=3; + pColAddValue=3; - pPol[pPolIndex]+=pPolAddValue; + pCol[pColIndex]+=pColAddValue; } nCount++; @@ -413,16 +413,16 @@ void Minimap::computeColors(int row, int localTeam) lr = lg = lb = 0; for (int i=0; i<3; i++) { - lr += pPol[i]*terrainColor[i][0]; - lg += pPol[i]*terrainColor[i][1]; - lb += pPol[i]*terrainColor[i][2]; + lr += pCol[i]*terrainColor[i][0]; + lg += pCol[i]*terrainColor[i][1]; + lb += pCol[i]*terrainColor[i][2]; } for (int i=0; iresourcesTypes.get(i); - lr += pPol[i+3]*(rt->minimapR); - lg += pPol[i+3]*(rt->minimapG); - lb += pPol[i+3]*(rt->minimapB); + lr += pCol[i+3]*(rt->minimapR); + lg += pCol[i+3]*(rt->minimapG); + lb += pCol[i+3]*(rt->minimapB); } r = lr/nCount; diff --git a/src/NetMessage.cpp b/src/NetMessage.cpp index 00df1ede..584e4849 100644 --- a/src/NetMessage.cpp +++ b/src/NetMessage.cpp @@ -3123,13 +3123,8 @@ std::string NetSendReTeamingInformation::format() const bool NetSendReTeamingInformation::operator==(const NetMessage& rhs) const { - if(typeid(rhs)==typeid(NetSendReTeamingInformation)) - { - const NetSendReTeamingInformation& r = dynamic_cast(rhs); - if(r.reTeamingInfo == reTeamingInfo) - return true; - } - return false; + const NetSendReTeamingInformation* r = dynamic_cast(&rhs); + return r != nullptr && r->reTeamingInfo == reTeamingInfo; } diff --git a/src/NetMessage.h b/src/NetMessage.h index b92d6df6..159736eb 100644 --- a/src/NetMessage.h +++ b/src/NetMessage.h @@ -1220,7 +1220,6 @@ class NetNotReadyToLaunch : public NetMessage ///Retrieves playerID Uint16 getPlayerID() const; -private: private: Uint16 playerID; }; @@ -1256,7 +1255,6 @@ class NetRemoveAI : public NetMessage ///Retrieves playerNum Uint8 getPlayerNumber() const; -private: private: Uint8 playerNum; }; @@ -1295,7 +1293,6 @@ class NetChangePlayersTeam : public NetMessage ///Retrieves team Uint8 getTeam() const; -private: private: Uint8 player; Uint8 team; @@ -1359,7 +1356,6 @@ class NetRefuseGameStart : public NetMessage ///Retrieves refusalReason YOGServerGameStartRefusalReason getRefusalReason() const; -private: private: YOGServerGameStartRefusalReason refusalReason; }; @@ -1449,7 +1445,6 @@ class NetSetLatencyMode : public NetMessage ///Retrieves latencyAdjustment Uint8 getLatencyAdjustment() const; -private: private: Uint8 latencyAdjustment; }; @@ -1488,7 +1483,6 @@ class NetPlayerJoinsGame : public NetMessage ///Retrieves playerName std::string getPlayerName() const; -private: private: Uint16 playerID; std::string playerName; @@ -1525,7 +1519,6 @@ class NetAddAI : public NetMessage ///Retrieves type Uint8 getType() const; -private: private: Uint8 type; }; @@ -1561,7 +1554,6 @@ class NetSendReTeamingInformation : public NetMessage ///Retrieves reTeamingInfo NetReTeamingInformation getReTeamingInfo() const; -private: private: NetReTeamingInformation reTeamingInfo; }; @@ -1597,7 +1589,6 @@ class NetSendGameResult : public NetMessage ///Retrieves result YOGGameResult getGameResult() const; -private: private: YOGGameResult result; }; @@ -1741,7 +1732,6 @@ class NetSetGameInRouter : public NetMessage ///Retrieves gameID Uint16 getGameID() const; -private: private: Uint16 gameID; }; @@ -1777,7 +1767,6 @@ class NetSendAfterJoinGameInformation : public NetMessage ///Retrieves info YOGAfterJoinGameInformation getAfterJoinGameInformation() const; -private: private: YOGAfterJoinGameInformation info; }; @@ -1813,7 +1802,6 @@ class NetRouterAdministratorLogin : public NetMessage ///Retrieves password std::string getPassword() const; -private: private: std::string password; }; @@ -1849,7 +1837,6 @@ class NetRouterAdministratorSendCommand : public NetMessage ///Retrieves command std::string getCommand() const; -private: private: std::string command; }; @@ -1885,7 +1872,6 @@ class NetRouterAdministratorSendText : public NetMessage ///Retrieves text std::string getText() const; -private: private: std::string text; }; @@ -1948,7 +1934,6 @@ class NetRouterAdministratorLoginRefused : public NetMessage ///Retrieves reason YOGRouterAdministratorLoginRefusalReason getReason() const; -private: private: YOGRouterAdministratorLoginRefusalReason reason; }; @@ -1984,7 +1969,6 @@ class NetDownloadableMapInfos : public NetMessage ///Retrieves maps std::vector getMaps() const; -private: private: std::vector maps; }; @@ -2047,7 +2031,6 @@ class NetRequestMapUpload : public NetMessage ///Retrieves mapInfo YOGDownloadableMapInfo getMapInfo() const; -private: private: YOGDownloadableMapInfo mapInfo; }; @@ -2083,7 +2066,6 @@ class NetAcceptMapUpload : public NetMessage ///Retrieves fileID Uint16 getFileID() const; -private: private: Uint16 fileID; }; @@ -2119,7 +2101,6 @@ class NetRefuseMapUpload : public NetMessage ///Retrieves reason YOGMapUploadRefusalReason getReason() const; -private: private: YOGMapUploadRefusalReason reason; }; @@ -2155,7 +2136,6 @@ class NetCancelSendingFile : public NetMessage ///Retrieves fileID Uint16 getFileID() const; -private: private: Uint16 fileID; }; @@ -2191,7 +2171,6 @@ class NetCancelReceivingFile : public NetMessage ///Retrieves fileID Uint16 getFileID() const; -private: private: Uint16 fileID; }; @@ -2227,7 +2206,6 @@ class NetRequestMapThumbnail : public NetMessage ///Retrieves mapID Uint16 getMapID() const; -private: private: Uint16 mapID; }; @@ -2266,7 +2244,6 @@ class NetSendMapThumbnail : public NetMessage ///Retrieves thumbnail MapThumbnail getThumbnail() const; -private: private: Uint16 mapID; MapThumbnail thumbnail; @@ -2306,7 +2283,6 @@ class NetSubmitRatingOnMap : public NetMessage ///Retrieves rating Uint8 getRating() const; -private: private: Uint16 mapID; Uint8 rating; diff --git a/src/SGSL.cpp b/src/SGSL.cpp index 1bcbd97e..7f91e614 100644 --- a/src/SGSL.cpp +++ b/src/SGSL.cpp @@ -74,7 +74,7 @@ SGSLToken::TokenSymbolLookupTable SGSLToken::table[] = { S_SUMMON_FLAG, "summonFlag" }, { S_DESTROY_FLAG, "destroyFlag" }, { S_WIN, "win" }, - { S_LOOSE, "loose" }, + { S_LOSE, "loose" }, { S_LABEL, "label" }, { S_JUMP, "jump" }, { S_SET_AREA, "setArea"}, @@ -402,7 +402,7 @@ void Story::setHighlightItem(GameGUI* gui, bool doSet) } else if(n=="forbidden zone on panel") { - t=GameGUI::HighlightWorkersWorkingFreeStat; + t=GameGUI::HighlightForbiddenZoneOnPanel; } else if(n=="guard zone on panel") { @@ -503,7 +503,7 @@ void Story::resetAI(GameGUI* gui) static const FunctionArgumentDescription totoDescription[] = { - { SGSLToken::S_WIN, SGSLToken::S_LOOSE }, + { SGSLToken::S_WIN, SGSLToken::S_LOSE }, { SGSLToken::INT, SGSLToken::INT }, { -1, -1} }; @@ -631,7 +631,7 @@ bool Story::testCondition(GameGUI *gui) return true; } - case (SGSLToken::S_LOOSE): + case (SGSLToken::S_LOSE): { mapScript->hasLost.at(line[++lineSelector].value)=true; return true; @@ -2379,7 +2379,7 @@ ErrorReport MapScriptSGSL::parseScript(Acquisition *donnees, Game *game) } break; - case (SGSLToken::S_LOOSE): + case (SGSLToken::S_LOSE): case (SGSLToken::S_WIN): { thisOne.line.push_back(*donnees->getToken()); diff --git a/src/SGSL.h b/src/SGSL.h index 99a50ce7..8823258c 100644 --- a/src/SGSL.h +++ b/src/SGSL.h @@ -78,7 +78,7 @@ struct SGSLToken S_SUMMON_FLAG, S_DESTROY_FLAG, S_WIN, - S_LOOSE, + S_LOSE, S_LABEL, S_JUMP, S_SET_AREA, diff --git a/src/YOGClientPlayerListManager.h b/src/YOGClientPlayerListManager.h index c0258fc7..3a352f91 100644 --- a/src/YOGClientPlayerListManager.h +++ b/src/YOGClientPlayerListManager.h @@ -37,10 +37,10 @@ class YOGClientPlayerListManager ///Receives an incoming message void receiveMessage(boost::shared_ptr message); - ///This will return the list of players on hosted on the server. + ///This will return the list of players hosted on the server. const std::list& getPlayerList() const; - ///This will return the list of players on hosted on the server. + ///This will return the list of players hosted on the server. std::list& getPlayerList(); ///This will add a listener for events saying the player list has been updated diff --git a/src/YOGServerPlayer.cpp b/src/YOGServerPlayer.cpp index 5456ae1e..9da09ee4 100644 --- a/src/YOGServerPlayer.cpp +++ b/src/YOGServerPlayer.cpp @@ -179,7 +179,7 @@ void YOGServerPlayer::update() { nGame->startGame(); } - //This receives requests a map file + //This receives a request for a map file else if(type==MNetRequestFile) { shared_ptr info = static_pointer_cast(message);