Пример #1
0
        public int GetNormalProductivity(IPlayer player)
        {
            float mult = 1.0f;
            int productivity = 0;
            if (kind == HexaKind.Desert ||
               kind == HexaKind.Nothing ||
               kind == HexaKind.Null ||
               kind == HexaKind.Water)
                return 0;

            foreach (TownModel town in towns)
            {
                if (town.GetOwner() == player &&
                    town.GetBuildingKind(hexaID) == BuildingKind.SourceBuilding)
                {
                    switch (player.GetMonasteryUpgrade(buildingKind))
                    {
                        case UpgradeKind.NoUpgrade: mult = 1.0f; break;
                        case UpgradeKind.FirstUpgrade: mult = 1.5f; break;
                        case UpgradeKind.SecondUpgrade: mult = 2.0f; break;
                    }

                    productivity += (int)(mult * startSource);
                }
            }

            return productivity;
        }