Skip to content

Commit 77f8e43

Browse files
committed
Renamed ActionEnum to CellActionEnum
1 parent b7cab47 commit 77f8e43

6 files changed

Lines changed: 11 additions & 10 deletions

File tree

CellSimulator.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@
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" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
namespace CellSimulator.Enums
33
{
4-
public enum ActionEnum
4+
public enum CellActionEnum
55
{
66
Born,
77
SuccessSplit,

Interfaces/ICell.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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();

Logic/CellOverseer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

Logic/SaveLoadManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

Models/Cell.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)