示例#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];
 }