Exemplo n.º 1
0
 public void AddPiece(Piece p, Coordinates coords)
 {
     if (!DoesPositionGoOffBoard(coords))
     {
         TileGrid[coords.X, coords.Y].CurrentPiece = p;
     }
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 4
0
 public bool DoesPositionGoOffBoard(Coordinates pos)
 {
     return
         pos.X < 0 || pos.X >= GetWidth() || pos.Y < 0 || pos.Y >= GetHeight()
             ? true
             : false;
 }
Exemplo n.º 5
0
 public Tile GetTile(Coordinates pos)
 {
     return DoesPositionGoOffBoard(pos)
         ? null
         : TileGrid[pos.X, pos.Y];
 }