/// <summary> /// Retrieves a list of the countries that are a part of this continent. /// </summary> /// <param name="game">The game that this continent is a part of.</param> /// <returns>A list of the countries that are a part of this continent.</returns> public List<Country> Countries(Game game) { List<Country> countries = new List<Country>(); foreach (string name in CountryNames) { countries.Add(game.Countries[name]); } return countries; }
/// <summary> /// Returns whether or not the given player owns this continent. /// </summary> /// <param name="game">The game that this continent is a part of.</param> /// <param name="playerName">The name of the player who may own this country.</param> /// <returns>Whether or not the given player owns this continent.</returns> public bool OwnedByName(Game game, PlayerNumber playerName) { foreach(Country country in Countries(game)) { if(country.OwnedBy != playerName) { return false; } } return true; }
public static Game DisposeAndAcreateNewGame() { Instance = new Game(); return Instance; }