@@ -15,7 +15,7 @@ public class CellOverseer
1515
1616 public CellOverseer ( int startingCells )
1717 {
18- for ( int i = 0 ; i < startingCells ; ++ i )
18+ for ( int i = 0 ; i < startingCells ; ++ i )
1919 {
2020 AddNewCell ( cells ) ;
2121 }
@@ -28,13 +28,13 @@ public void AddNewCell(List<Cell> cellList)
2828 public void SimulateNext ( )
2929 {
3030 List < Cell > stillAliveCells = new List < Cell > ( ) ;
31- foreach ( Cell cell in cells )
31+ foreach ( Cell cell in cells )
3232 {
33- if ( cell . energy <= 0 || cell . food <= 0 )
33+ if ( cell . energy <= 0 || cell . food <= 0 )
3434 {
3535 continue ;
3636 }
37- if ( cell . food >= 60 )
37+ if ( cell . food >= 60 )
3838 {
3939 if ( cell . Split ( rand ) )
4040 {
@@ -58,8 +58,8 @@ public void SimulateNext()
5858 else
5959 {
6060 cell . lastAction = "FailEat" ;
61- }
62- }
61+ }
62+ }
6363 cell . energy -= 5 ;
6464 cell . food -= 5 ;
6565 if ( cell . energy <= 0 || cell . food <= 0 )
@@ -74,7 +74,7 @@ public void SimulateNext()
7474 public void SaveToFile ( )
7575 {
7676 List < string > linesToAppend = new List < string > ( ) ;
77- foreach ( Cell cell in cells )
77+ foreach ( Cell cell in cells )
7878 {
7979 string lineToAppend = cell . id + "|" + cell . age + "|" + cell . food + "|" + cell . maxFood + "|" + cell . energy + "|" + cell . maxEnergy + "|" + cell . lastAction ;
8080 linesToAppend . Add ( lineToAppend ) ;
@@ -83,15 +83,15 @@ public void SaveToFile()
8383 File . AppendAllLines ( "CellList-" + nameAppender + ".txt" , linesToAppend ) ;
8484 }
8585 public bool LoadFromFile ( string fileName )
86- {
87- if ( ! File . Exists ( fileName ) )
86+ {
87+ if ( ! File . Exists ( fileName ) )
8888 {
8989 return false ;
9090 }
9191
9292 List < Cell > listOfCells = new List < Cell > ( ) ;
9393 string [ ] dataLines = File . ReadAllLines ( fileName ) ;
94- foreach ( string dataLine in dataLines )
94+ foreach ( string dataLine in dataLines )
9595 {
9696 string [ ] splitDataLine = dataLine . Split ( '|' ) ;
9797 Cell tempCell = new Cell ( cellIdCounter )
0 commit comments