示例#1
0
        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;
                }
            }
        }
示例#2
0
        public int GetCitizenCount()
        {
            int count = 0;

            foreach (CityLoyaltyEntry entry in PlayerTable.OfType <CityLoyaltyEntry>())
            {
                if (entry.IsCitizen)
                {
                    count++;
                }
            }

            return(count);
        }