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; }
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); }
public Spellcasting(Gameboard gameboard, GameEngine gameEngine) { this.gameEngine = gameEngine; }
public MonsterActions(Gameboard gameboard, GameEngine gameEngine) { this.gameboard = gameboard; this.gameEngine = gameEngine; }