예제 #1
0
 /// <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);
예제 #2
0
 public bool Equals(Position2D other)
 {
     return(X == other.X && Y == other.Y);
 }
예제 #3
0
 /// <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);
예제 #4
0
 /// <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)));
 }
예제 #5
0
 // can be used as method group
 public static MovePieceAction New(Position2D src, Position2D dst)
 {
     return(new MovePieceAction(src, dst));
 }
예제 #6
0
 private MovePieceAction(Position2D src, Position2D dst) : base(src, dst)
 {
 }
예제 #7
0
 private MoveBallAction(Position2D src, Position2D dst) : base(src, dst)
 {
 }