Refactor cells for dual tile rendering
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
namespace ReactorMaintenance.Simulation;
|
||||
|
||||
public enum ECellKind
|
||||
public enum ECellTerrain
|
||||
{
|
||||
Empty,
|
||||
Floor,
|
||||
Wall,
|
||||
Wall
|
||||
}
|
||||
|
||||
public enum ECellProp
|
||||
{
|
||||
None,
|
||||
Reactor,
|
||||
CoolingPump,
|
||||
Generator,
|
||||
@@ -68,7 +72,8 @@ public sealed record HazardState
|
||||
|
||||
public sealed record CellState
|
||||
{
|
||||
public ECellKind Kind { get; init; } = ECellKind.Floor;
|
||||
public ECellTerrain Terrain { get; init; } = ECellTerrain.Floor;
|
||||
public ECellProp Prop { get; init; }
|
||||
public EPipeMedium Pipe { get; init; }
|
||||
public int Flow { get; init; }
|
||||
public int Pressure { get; init; }
|
||||
@@ -78,7 +83,7 @@ public sealed record CellState
|
||||
public bool Powered { get; init; }
|
||||
public bool DoorLocked { get; init; }
|
||||
public HazardState Hazards { get; init; } = new();
|
||||
public bool IsWalkable => Kind != ECellKind.Wall && Kind != ECellKind.Empty;
|
||||
public bool IsWalkable => Terrain != ECellTerrain.Wall;
|
||||
public bool HasPipe => Pipe != EPipeMedium.None;
|
||||
}
|
||||
|
||||
@@ -110,7 +115,7 @@ public sealed record LevelState
|
||||
for (var x = Balancing.Current.FirstGridCoordinate; x < width; x++)
|
||||
{
|
||||
if (x == Balancing.Current.FirstGridCoordinate || y == Balancing.Current.FirstGridCoordinate || x == width - Balancing.Current.NeighborDistance || y == height - Balancing.Current.NeighborDistance)
|
||||
cells[y * width + x] = cells[y * width + x] with { Kind = ECellKind.Wall };
|
||||
cells[y * width + x] = cells[y * width + x] with { Terrain = ECellTerrain.Wall };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user