Skip to content

Commit a91ca1d

Browse files
Corrected orthograph of AI source code.
1 parent 3e7d38e commit a91ca1d

File tree

11 files changed

+338
-338
lines changed

11 files changed

+338
-338
lines changed

src/AICastor.cpp

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ bool AICastor::addProject(Project *project)
12501250
{
12511251
if (buildingSum[project->shortTypeNum][0]>=project->amount)
12521252
{
1253-
fprintf(logFile, "will not add project (%s x%d) as it already succeded\n", project->debugName, project->amount);
1253+
fprintf(logFile, "will not add project (%s x%d) as it already succeeded\n", project->debugName, project->amount);
12541254
delete project;
12551255
return false;
12561256
}
@@ -1281,8 +1281,8 @@ bool AICastor::addProject(Project *project)
12811281

12821282
void AICastor::addProjects()
12831283
{
1284-
//printf(" canFeedUnit=%d, swarms=%d, pool=%d+%d, attaque=%d+%d, speed=%d+%d\n",
1285-
// canFeedUnit, swarms, pool, poolSite, attaque, attaqueSite, speed, speedSite);
1284+
//printf(" canFeedUnit=%d, swarms=%d, pool=%d+%d, attack=%d+%d, speed=%d+%d\n",
1285+
// canFeedUnit, swarms, pool, poolSite, attack, attackSite, speed, speedSite);
12861286

12871287
buildsAmount=-1;
12881288

@@ -1376,7 +1376,7 @@ void AICastor::addProjects()
13761376
if (addProject(project))
13771377
return;
13781378
}*/
1379-
// all critical projects succeded.
1379+
// all critical projects succeeded.
13801380

13811381
// enough workers
13821382
//Strategy::Builds buildsCurrent=strategy.buildsBase;
@@ -1492,7 +1492,7 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
14921492
{
14931493
// boot phase
14941494
project->subPhase=2;
1495-
fprintf(logFile, "(%s) (boot) (switching to subphase 2)\n", project->debugName);
1495+
fprintf(logFile, "(%s) (boot) (switching to sub-phase 2)\n", project->debugName);
14961496
}
14971497
else if (project->subPhase==1)
14981498
{
@@ -1518,9 +1518,9 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
15181518
computeWorkRangeMap();
15191519
computeWorkAbilityMap();
15201520

1521-
boost::shared_ptr<Order>gfbm=findGoodBuilding(typeNum, project->food, project->defense, project->critical);
1521+
boost::shared_ptr<Order>gFbm=findGoodBuilding(typeNum, project->food, project->defense, project->critical);
15221522
project->timer=timer;
1523-
if (gfbm)
1523+
if (gFbm)
15241524
{
15251525
if (project->successWait>0)
15261526
{
@@ -1530,8 +1530,8 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
15301530
else
15311531
{
15321532
project->subPhase=2;
1533-
fprintf(logFile, "(%s) (one construction site placed) (switching to next subphase 2)\n", project->debugName);
1534-
return gfbm;
1533+
fprintf(logFile, "(%s) (one construction site placed) (switching to next sub-phase 2)\n", project->debugName);
1534+
return gFbm;
15351535
}
15361536
}
15371537
else if (project->triesLeft>0)
@@ -1557,29 +1557,29 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
15571557
if (real>=project->amount)
15581558
{
15591559
project->subPhase=6;
1560-
fprintf(logFile, "(%s) ([%d>=%d] building finished) (switching to subphase 6).\n",
1560+
fprintf(logFile, "(%s) ([%d>=%d] building finished) (switching to sub-phase 6).\n",
15611561
project->debugName, real, project->amount);
15621562
if (!project->waitFinished)
15631563
{
1564-
fprintf(logFile, "(%s) (deblocking [%d, %d])\n", project->debugName, project->blocking, project->critical);
1564+
fprintf(logFile, "(%s) (de-blocking [%d, %d])\n", project->debugName, project->blocking, project->critical);
15651565
project->blocking=false;
15661566
project->critical=false;
15671567
}
15681568
}
15691569
else if (sum<project->amount)
15701570
{
15711571
project->subPhase=1;
1572-
fprintf(logFile, "(%s) (need more construction site [%d+%d<%d]) (switching back to subphase 1)\n",
1572+
fprintf(logFile, "(%s) (need more construction site [%d+%d<%d]) (switching back to sub-phase 1)\n",
15731573
project->debugName, real, site, project->amount);
15741574
}
15751575
else
15761576
{
15771577
project->subPhase=3;
1578-
fprintf(logFile, "(%s) (enough real building site found [%d+%d>=%d]) (switching to next subphase 3)\n",
1578+
fprintf(logFile, "(%s) (enough real building site found [%d+%d>=%d]) (switching to next sub-phase 3)\n",
15791579
project->debugName, real, site, project->amount);
15801580
if (!project->waitFinished)
15811581
{
1582-
fprintf(logFile, "(%s) (deblocking [%d, %d])\n", project->debugName, project->blocking, project->critical);
1582+
fprintf(logFile, "(%s) (de-blocking [%d, %d])\n", project->debugName, project->blocking, project->critical);
15831583
project->blocking=false;
15841584
project->critical=false;
15851585
}
@@ -1677,13 +1677,13 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
16771677
if (real>=project->amount)
16781678
{
16791679
project->subPhase=6;
1680-
fprintf(logFile, "(%s) (building finished [%d+%d>=%d]) (switching to subphase 6).\n",
1680+
fprintf(logFile, "(%s) (building finished [%d+%d>=%d]) (switching to sub-phase 6).\n",
16811681
project->debugName, real, site, project->amount);
16821682
}
16831683
else if (sum<project->amount)
16841684
{
16851685
project->subPhase=1;
1686-
fprintf(logFile, "(%s) (need more construction site [%d+%d<%d]) (switching back to subphase 1)\n",
1686+
fprintf(logFile, "(%s) (need more construction site [%d+%d<%d]) (switching back to sub-phase 1)\n",
16871687
project->debugName, real, site, project->amount);
16881688
}
16891689
else if (project->multipleStart)
@@ -1693,18 +1693,18 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
16931693
if (isFree>1)
16941694
{
16951695
project->subPhase=1;
1696-
fprintf(logFile, "(%s) (enough free workers %d) (switching back to subphase 1)\n", project->debugName, isFree);
1696+
fprintf(logFile, "(%s) (enough free workers %d) (switching back to sub-phase 1)\n", project->debugName, isFree);
16971697
}
16981698
else
16991699
{
17001700
project->subPhase=5;
1701-
fprintf(logFile, "(%s) (no more free workers) (switching to next subphase 5)\n", project->debugName);
1701+
fprintf(logFile, "(%s) (no more free workers) (switching to next sub-phase 5)\n", project->debugName);
17021702
}
17031703
}
17041704
else
17051705
{
17061706
project->subPhase=5;
1707-
fprintf(logFile, "(%s) (enough construction site [%d+%d>=%d]) (switching to next subphase 5)\n",
1707+
fprintf(logFile, "(%s) (enough construction site [%d+%d>=%d]) (switching to next sub-phase 5)\n",
17081708
project->debugName, real, site, project->amount);
17091709
}
17101710
}
@@ -1739,13 +1739,13 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
17391739
if (real>=project->amount)
17401740
{
17411741
project->subPhase=6;
1742-
fprintf(logFile, "(%s) (building finished [%d+%d>=%d]) (switching to subphase 6).\n",
1742+
fprintf(logFile, "(%s) (building finished [%d+%d>=%d]) (switching to sub-phase 6).\n",
17431743
project->debugName, real, site, project->amount);
17441744
}
17451745
else if (sum<project->amount)
17461746
{
17471747
project->subPhase=2;
1748-
fprintf(logFile, "(%s) (building destroyed! [%d+%d<%d]) (switching to subphase 2).\n",
1748+
fprintf(logFile, "(%s) (building destroyed! [%d+%d<%d]) (switching to sub-phase 2).\n",
17491749
project->debugName, real, site, project->amount);
17501750
}
17511751
}
@@ -1755,7 +1755,7 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
17551755

17561756
if (project->blocking)
17571757
{
1758-
fprintf(logFile, "(%s) (deblocking [%d, %d])\n", project->debugName, project->blocking, project->critical);
1758+
fprintf(logFile, "(%s) (de-blocking [%d, %d])\n", project->debugName, project->blocking, project->critical);
17591759
project->blocking=false;
17601760
project->critical=false;
17611761
}
@@ -1784,7 +1784,7 @@ boost::shared_ptr<Order>AICastor::continueProject(Project *project)
17841784
if (buildingSum[project->shortTypeNum][1]==0)
17851785
{
17861786
project->finished=true;
1787-
fprintf(logFile, "(%s) (all finalWorkers set) (project succeded)\n", project->debugName);
1787+
fprintf(logFile, "(%s) (all finalWorkers set) (project succeeded)\n", project->debugName);
17881788
}
17891789
}
17901790
else
@@ -1834,8 +1834,8 @@ bool AICastor::enoughFreeWorkers()
18341834
void AICastor::computeCanSwim()
18351835
{
18361836
//printf("computeCanSwim()...\n");
1837-
// If our population has more healthy-working-units able to swimm than healthy-working-units
1838-
// unable to swimm then we choose to be able to go trough water:
1837+
// If our population has more healthy-working-units able to swim than healthy-working-units
1838+
// unable to swim then we choose to be able to go trough water:
18391839
Unit **myUnits=team->myUnits;
18401840
int sumCanSwim=0;
18411841
int sumCantSwim=0;
@@ -2016,7 +2016,7 @@ void AICastor::computeObstacleUnitMap()
20162016
obstacleUnitMap[i]=0;
20172017
else if (c.forbidden&teamMask)
20182018
obstacleUnitMap[i]=0;
2019-
else if (!canSwim && (c.terrain>=256) && (c.terrain<256+16)) // !canSwim && isWatter ?
2019+
else if (!canSwim && (c.terrain>=256) && (c.terrain<256+16)) // !canSwim && isWater ?
20202020
obstacleUnitMap[i]=0;
20212021
else
20222022
obstacleUnitMap[i]=1;
@@ -2106,7 +2106,7 @@ void AICastor::computeBuildingNeighbourMapOfBuilding(int bx, int by, int bw, int
21062106
Uint8 *gradient=buildingNeighbourMap;
21072107
const auto& tiles=map->tiles;
21082108

2109-
//Uint8 *wheatGradient=map->ressourcesGradient[team->teamNumber][CORN][canSwim];
2109+
//Uint8 *wheatGradient=map->resourcesGradient[team->teamNumber][CORN][canSwim];
21102110

21112111
/*int bx=b->posX;
21122112
int by=b->posY;
@@ -2514,7 +2514,7 @@ void AICastor::computeWheatCareMap()
25142514
//int wDec=map->wDec;
25152515
size_t size=w*h;
25162516
size_t sizeMask=(size-1);
2517-
//Uint8 *wheatGradient=map->ressourcesGradient[team->teamNumber][CORN][canSwim];
2517+
//Uint8 *wheatGradient=map->resourcesGradient[team->teamNumber][CORN][canSwim];
25182518
//Tile *tiles=map->tiles;
25192519
//Uint32 teamMask=team->me;
25202520

@@ -2925,7 +2925,7 @@ void AICastor::computeResourcesCluster()
29252925
{
29262926
const auto& c = map->tiles[map->coordToIndex(x, y)]; // case
29272927
const auto& r=c.resource; // resource
2928-
Uint8 rt=r.type; // ressources type
2928+
Uint8 rt=r.type; // resources type
29292929

29302930
int rci=x+y*w; // resource cluster index
29312931
Uint16 *rcp=&resourcesCluster[rci]; // resource cluster pointer
@@ -2959,13 +2959,13 @@ void AICastor::computeResourcesCluster()
29592959
}
29602960
else
29612961
{
2962-
Uint16 oldid=id;
2963-
usedId[oldid]=false;
2962+
Uint16 oldId=id;
2963+
usedId[oldId]=false;
29642964
id=rc; // newid
2965-
fprintf(logFile, " cleaning oldid=%d to id=%d.\n", oldid, id);
2965+
fprintf(logFile, " cleaning oldId=%d to id=%d.\n", oldId, id);
29662966
// We have to correct last resourcesCluster values:
29672967
*rcp=id;
2968-
while (*rcp==oldid)
2968+
while (*rcp==oldId)
29692969
{
29702970
*rcp=id;
29712971
rcp--;

src/AICastor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class AICastor : public AIImplementation
5252
IntBuildingType::Number shortTypeNum;
5353
int amount; // number of buildings wanted
5454
bool food; // place closer to wheat of further
55-
bool defense; // place at incpoming places.
55+
bool defense; // place at incoming places.
5656

5757
std::string debugStdName;
5858
const char *debugName;
@@ -201,7 +201,7 @@ class AICastor : public AIImplementation
201201
bool strikeTeamSelected;
202202
int strikeTeam;
203203

204-
bool foodWarning; // true if wwe are aproaching a foodLock
204+
bool foodWarning; // true if wwe are approaching a foodLock
205205
bool foodLock; // we stop producing any unit until we get more food buildings
206206
bool foodSurplus; // we have too many food buildings
207207
Uint32 foodLockStats[2];

src/AIDescriptionScreen.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ AIDescriptionScreen::AIDescriptionScreen()
3030
ok = new TextButton(440, 360, 180, 40, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "menu", Toolkit::getStringTable()->getString("[ok]"), OK, 13);
3131
addWidget(ok);
3232

33-
ailist = new List(60, 50, 200, 300, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "standard");
33+
aiList = new List(60, 50, 200, 300, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "standard");
3434
for (int aii=0; aii<AI::SIZE; aii++)
35-
ailist->addText(AINames::getAIText(aii));
36-
addWidget(ailist);
35+
aiList->addText(AINames::getAIText(aii));
36+
addWidget(aiList);
3737

3838
description = new TextArea(310, 50, 250, 300, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "standard", true);
3939
addWidget(description);
@@ -55,9 +55,9 @@ void AIDescriptionScreen::onAction(Widget *source, Action action, int par1, int
5555
}
5656
if (action == LIST_ELEMENT_SELECTED)
5757
{
58-
if(ailist->getSelectionIndex() != -1)
58+
if(aiList->getSelectionIndex() != -1)
5959
{
60-
description->setText(AINames::getAIDescription(ailist->getSelectionIndex()).c_str());
60+
description->setText(AINames::getAIDescription(aiList->getSelectionIndex()).c_str());
6161
}
6262
}
6363
}

src/AIDescriptionScreen.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class AIDescriptionScreen : public Glob2Screen
4646
private:
4747
TextButton* ok;
4848
TextArea *description;
49-
List *ailist;
49+
List *aiList;
5050
Text *title;
5151
};
5252

0 commit comments

Comments
 (0)