/// <summary> /// Returns the player at the specified position. /// Returns null if the tile is empty or out of bounds. /// </summary> /// <returns>The player, or null</returns> public abstract Player PlayerOn(Position2D p);
public bool Equals(Position2D other) { return(X == other.X && Y == other.Y); }
/// <summary> /// Returns true if the position has no piece on it. /// Doesn't check for validity of the position. /// </summary> public abstract bool IsFree(Position2D p);
/// <summary> /// Moves a piece from src to dst. Returns the updated state. /// </summary> /// <param name="src">Original position</param> /// <param name="dst">New position</param> /// <returns>The updated state</returns> public GameState MovePiece(Position2D src, Position2D dst) { return(GetNextStateWithBoard(UnderlyingBoard.MovePiece(src, dst))); }
// can be used as method group public static MovePieceAction New(Position2D src, Position2D dst) { return(new MovePieceAction(src, dst)); }
private MovePieceAction(Position2D src, Position2D dst) : base(src, dst) { }
private MoveBallAction(Position2D src, Position2D dst) : base(src, dst) { }