/// <summary> /// Constructor, used for creating base coordinates /// </summary> /// <param name="f">Floor</param> /// <param name="r">Row</param> /// <param name="c">Col</param> public WallElementPosition(Floor f, int r, int c) { Floor = f; Row = r; Col = c; }
public WallElementLeftPosition(Floor f, int row, int col) : base(f, row, col) { }
/// <summary> /// Add floor as last one /// </summary> /// <param name="f">New floor</param> public void AddFloor(Floor f) { AddFloor(Floors.Count, f); }
/// <summary> /// Method factory /// </summary> /// <param name="f">Floor</param> /// <param name="row">Row</param> /// <param name="col">Col</param> /// <param name="dir">Orientation</param> /// <returns>Created position</returns> public static WallElementPosition Create(Floor f, int row, int col, Direction dir) { switch (dir) { case Direction.DOWN: return new WallElementDownPosition(f, row, col); case Direction.LEFT: return new WallElementLeftPosition(f, row, col); case Direction.RIGHT: return new WallElementRightPosition(f, row, col); default: return new WallElementUpPosition(f, row, col); } }
/// <summary> /// Add floor with given number /// </summary> /// <param name="number">Number of the new floor</param> /// <param name="f">New floor</param> public void AddFloor(int number, Floor f) { Floors.Add(number, f); f.Number = number; }