コード例 #1
0
ファイル: Game.cs プロジェクト: chow-land/GriddyBackend
 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
ファイル: Game.cs プロジェクト: chow-land/GriddyBackend
 public bool DoesPositionGoOffBoard(Coordinates pos)
 {
     return
         pos.X < 0 || pos.X >= GetWidth() || pos.Y < 0 || pos.Y >= GetHeight()
             ? true
             : false;
 }
コード例 #5
0
ファイル: Game.cs プロジェクト: chow-land/GriddyBackend
 public Tile GetTile(Coordinates pos)
 {
     return DoesPositionGoOffBoard(pos)
         ? null
         : TileGrid[pos.X, pos.Y];
 }