public Corridor(Position startingPosition, Direction direction, int maxLenght, IFeature spawningFeature) { Trail = new List<Floor>(); ConnectedFeatureA = spawningFeature; Direction = direction; InitTrail(startingPosition, maxLenght); }
private void InitTrail(Position startingPosition, int maxLenght) { Position increase; switch (Direction) { case Direction.North: increase = Position.North; break; case Direction.South: increase = Position.South; break; case Direction.East: increase = Position.East; break; default: increase = Position.West; break; } for (var i = 0; i < maxLenght; i++) { Trail.Add(new Floor(startingPosition + increase * i)); } }
public Room(Position pos, int w, int h) { Position = pos; Width = w; Height = h; InitFloor(); InitWalls(); }
public TileType[,] Export() { var e = new TileType[Width, Height]; for (int y = 0; y < Height; y++) { for (int x = 0; x < Width; x++) { var key = new Position(x, y); if (OccupiedPoints.ContainsKey(key)) e[x, y] = OccupiedPoints[key]; else e[x, y] = TileType.Empty; } } return e; }