public OXGameState(string aPlayerA, string aPlayerB, OXActor aJustActed) : base(aPlayerA, aPlayerB, aJustActed, GRID_SIZE, GRID_SIZE)
 {
     for (int x = 0; x < GridWidth; ++x)
     {
         for (int y = 0; y < GridHeight; ++y)
         {
             Grid[x, y] = null;
         }
     }
 }
        public override IEnumerable <IAction> GetAllMoves()
        {
            List <IAction> actions = new List <IAction>();

            OXActor nowActing = new OXActor(ActorJustActed.Name.Equals(PlayerAName) ? PlayerBName : PlayerAName);

            for (int x = 0; x < GridWidth; x++)
            {
                for (int y = 0; y < GridHeight; y++)
                {
                    if (Grid[x, y] == null)
                    {
                        IAction newAction = new OXAction(nowActing, this, x, y);
                        actions.Add(newAction);
                    }
                }
            }

            return(actions);
        }
示例#3
0
 public OXAction(OXActor aActing, OXGameState aState, int x, int y) : base(aActing)
 {
     this._incomingState = aState;
     this._x             = x;
     this._y             = y;
 }
 public OXGameState(OXGameState aOtherGameState, OXActor aJustActed, AbstractActor[,] aGrid) : base(aOtherGameState.PlayerAName, aOtherGameState.PlayerBName, aJustActed, aGrid)
 {
 }
 public OXGameState(string aPlayerA, string aPlayerB, OXActor aJustActed, AbstractActor[,] aGrid) : base(aPlayerA, aPlayerB, aJustActed, aGrid)
 {
 }