File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444 <ItemGroup >
4545 <Compile Include =" Cell.cs" />
4646 <Compile Include =" CellOverseer.cs" />
47- <Compile Include =" Enums\ActionEnum .cs" />
47+ <Compile Include =" Enums\CellActionEnum .cs" />
4848 <Compile Include =" Interfaces\ICell.cs" />
49+ <Compile Include =" Interfaces\IConsoleWriter.cs" />
4950 <Compile Include =" Interfaces\ICellOverseer.cs" />
5051 <Compile Include =" Interfaces\ISaveLoadManager.cs" />
5152 <Compile Include =" Logic\SaveLoadManager.cs" />
Original file line number Diff line number Diff line change 11
22namespace CellSimulator . Enums
33{
4- public enum ActionEnum
4+ public enum CellActionEnum
55 {
66 Born ,
77 SuccessSplit ,
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ public interface ICell
1010 int MaxFood { get ; set ; }
1111 int Energy { get ; set ; }
1212 int MaxEnergy { get ; set ; }
13- ActionEnum LastAction { get ; set ; }
13+ CellActionEnum LastAction { get ; set ; }
1414 bool IsAlive { get ; set ; }
1515
1616 bool TrySplit ( ) ;
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public void SimulateNext()
3636 {
3737 CellList . Remove ( cell ) ;
3838 }
39- else if ( cell . LastAction == Enums . ActionEnum . SuccessSplit )
39+ else if ( cell . LastAction == Enums . CellActionEnum . SuccessSplit )
4040 {
4141 AddCell ( ) ;
4242 }
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ private IEnumerable<ICell> LoadCellList(string fileName)
4545 MaxFood = int . Parse ( currentLineValues [ 3 ] ) ,
4646 Energy = int . Parse ( currentLineValues [ 4 ] ) ,
4747 MaxEnergy = int . Parse ( currentLineValues [ 5 ] ) ,
48- LastAction = ( ActionEnum ) Enum . Parse ( typeof ( ActionEnum ) , currentLineValues [ 6 ] )
48+ LastAction = ( CellActionEnum ) Enum . Parse ( typeof ( CellActionEnum ) , currentLineValues [ 6 ] )
4949 } ) ;
5050 }
5151 }
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ public class Cell : ICell
1616 public int MaxFood { get ; set ; }
1717 public int Energy { get ; set ; }
1818 public int MaxEnergy { get ; set ; }
19- public ActionEnum LastAction { get ; set ; }
19+ public CellActionEnum LastAction { get ; set ; }
2020 public bool IsAlive { get ; set ; } = true ;
2121
2222 private const double PROPABILITY_EAT_FOOD = 0.25 ;
@@ -68,25 +68,25 @@ public void PerformAction()
6868 {
6969 if ( TrySplit ( ) )
7070 {
71- LastAction = ActionEnum . SuccessSplit ;
71+ LastAction = CellActionEnum . SuccessSplit ;
7272 Food -= FOOD_REQUIRED_FOR_SUCCESSFUL_SPLIT ;
7373 Energy -= ENERGY_REQUIRED_FOR_SPLIT ;
7474 }
7575 else
7676 {
77- LastAction = ActionEnum . FailSplit ;
77+ LastAction = CellActionEnum . FailSplit ;
7878 }
7979 Energy -= FOOD_REQUIRED_FOR_TRY_SPLIT ;
8080 }
8181 else
8282 {
8383 if ( TryEat ( ) )
8484 {
85- LastAction = ActionEnum . SuccessEat ;
85+ LastAction = CellActionEnum . SuccessEat ;
8686 }
8787 else
8888 {
89- LastAction = ActionEnum . FailEat ;
89+ LastAction = CellActionEnum . FailEat ;
9090 }
9191 }
9292 Energy -= FOOD_CONSUMED_PER_ACTION ;
You can’t perform that action at this time.
0 commit comments