Пример #1
0
 public void AddPiece(Piece p, Coordinates coords)
 {
     if (!DoesPositionGoOffBoard(coords))
     {
         TileGrid[coords.X, coords.Y].CurrentPiece = p;
     }
 }
Пример #2
0
 public MoveAbility(MoveAbilityModel model)
 {
     Multiplicity = model.Multiplicity;
     CanCapture = model.CanCapture;
     CaptureOnly = model.CaptureOnly;
     PositionDelta = new Coordinates(model.PositionDelta);
     MoveOnly = model.MoveOnly;
     FirstMoveOnly = model.FirstMoveOnly;
     CanHop = model.CanHop;
 }
Пример #3
0
 public MoveAbility(int multiplicity, bool canCapture, bool captureOnly, int xChange, int yChange, bool moveOnly, bool canHop, bool firstMoveOnly)
 {
     PositionDelta = new Coordinates(xChange, yChange);
     Multiplicity = multiplicity;
     CanCapture = canCapture;
     CanHop = canHop;
     CaptureOnly = captureOnly;
     MoveOnly = moveOnly;
     FirstMoveOnly = firstMoveOnly;
 }
Пример #4
0
 public bool DoesPositionGoOffBoard(Coordinates pos)
 {
     return
         pos.X < 0 || pos.X >= GetWidth() || pos.Y < 0 || pos.Y >= GetHeight()
             ? true
             : false;
 }
Пример #5
0
 public Tile GetTile(Coordinates pos)
 {
     return DoesPositionGoOffBoard(pos)
         ? null
         : TileGrid[pos.X, pos.Y];
 }