示例#1
0
 public GameEngine(int NumberOfPlayers, Gameboard gameboard, GameForm gameForm, int turnsLimit, bool autogenerate = true)
 {
     this.gameboard  = gameboard;
     this.turnsLimit = turnsLimit * NumberOfPlayers;
     actions         = new MonsterActions(gameboard, this);
     SetTileEvents();
     if (autogenerate)
     {
         GenerateWizards(NumberOfPlayers);
         CurrentPlayer = Players[0];
     }
     gameboard.players = Players;
     spellcasting      = new Spellcasting(gameboard, this);
     this.gameForm     = gameForm;
     gameForm.GetDescriptionPanel.Click += HideDescriptionPanel;
 }
示例#2
0
        public static bool IsMoveLegal(Gameboard gameboard, Point sourcePoint, GameEngine gameengine)
        {
            if ((!(gameboard.GetRawTilesData[sourcePoint.X - 1, sourcePoint.Y].GetOccupant() is Nothing) &&
                 gameboard.GetRawTilesData[sourcePoint.X - 1, sourcePoint.Y].GetOccupant().Owner != gameengine.CurrentPlayer) ||
                (!(gameboard.GetRawTilesData[sourcePoint.X + 1, sourcePoint.Y].GetOccupant() is Nothing) &&
                 gameboard.GetRawTilesData[sourcePoint.X + 1, sourcePoint.Y].GetOccupant().Owner != gameengine.CurrentPlayer) ||
                (!(gameboard.GetRawTilesData[sourcePoint.X, sourcePoint.Y - 1].GetOccupant() is Nothing) &&
                 gameboard.GetRawTilesData[sourcePoint.X, sourcePoint.Y - 1].GetOccupant().Owner != gameengine.CurrentPlayer) ||
                (!(gameboard.GetRawTilesData[sourcePoint.X, sourcePoint.Y + 1].GetOccupant() is Nothing) &&
                 gameboard.GetRawTilesData[sourcePoint.X, sourcePoint.Y + 1].GetOccupant().Owner != gameengine.CurrentPlayer) ||
                (!(gameboard.GetRawTilesData[sourcePoint.X - 1, sourcePoint.Y - 1].GetOccupant() is Nothing) &&
                 gameboard.GetRawTilesData[sourcePoint.X - 1, sourcePoint.Y - 1].GetOccupant().Owner != gameengine.CurrentPlayer) ||
                (!(gameboard.GetRawTilesData[sourcePoint.X + 1, sourcePoint.Y + 1].GetOccupant() is Nothing) &&
                 gameboard.GetRawTilesData[sourcePoint.X + 1, sourcePoint.Y + 1].GetOccupant().Owner != gameengine.CurrentPlayer) ||
                (!(gameboard.GetRawTilesData[sourcePoint.X - 1, sourcePoint.Y + 1].GetOccupant() is Nothing) &&
                 gameboard.GetRawTilesData[sourcePoint.X - 1, sourcePoint.Y + 1].GetOccupant().Owner != gameengine.CurrentPlayer) ||
                (!(gameboard.GetRawTilesData[sourcePoint.X + 1, sourcePoint.Y - 1].GetOccupant() is Nothing) &&
                 gameboard.GetRawTilesData[sourcePoint.X + 1, sourcePoint.Y - 1].GetOccupant().Owner != gameengine.CurrentPlayer))
            {
                return(false);
            }

            return(true);
        }
示例#3
0
 public Spellcasting(Gameboard gameboard, GameEngine gameEngine)
 {
     this.gameEngine = gameEngine;
 }
示例#4
0
 public MonsterActions(Gameboard gameboard, GameEngine gameEngine)
 {
     this.gameboard  = gameboard;
     this.gameEngine = gameEngine;
 }