public void OnNewTradeDeal(TradeDeal newtradedeal) { if (ActiveTradeDeal == TradeDeal.None) { NextTradeDealCheck = DateTime.UtcNow + TimeSpan.FromDays(TradeDealCostPeriod); } else if (newtradedeal == TradeDeal.None) { NextTradeDealCheck = DateTime.MinValue; TradeDealStart = DateTime.MinValue; } else { TradeDealStart = DateTime.UtcNow; } ActiveTradeDeal = newtradedeal; if (Stone != null) { Stone.InvalidateProperties(); } foreach (CityLoyaltyEntry player in PlayerTable.OfType <CityLoyaltyEntry>()) { if (player.UtilizingTradeDeal) { player.UtilizingTradeDeal = false; } } }
public int GetCitizenCount() { int count = 0; foreach (CityLoyaltyEntry entry in PlayerTable.OfType <CityLoyaltyEntry>()) { if (entry.IsCitizen) { count++; } } return(count); }