Beispiel #1
0
 /// <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;
 }
Beispiel #2
0
 public WallElementLeftPosition(Floor f, int row, int col)
     : base(f, row, col)
 {
 }
Beispiel #3
0
 /// <summary>
 /// Add floor as last one
 /// </summary>
 /// <param name="f">New floor</param>
 public void AddFloor(Floor f)
 {
     AddFloor(Floors.Count, f);
 }
Beispiel #4
0
 /// <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);
     }
 }
Beispiel #5
0
 /// <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;
 }