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