public YieldSummary GetTotalYieldForCity(ICity city, YieldSummary additionalBonuses)
        {
            if (city == null)
            {
                throw new ArgumentNullException("city");
            }

            var retval = CityCenterYieldLogic.GetYieldOfCityCenter(city);

            foreach (var cell in CellPossessionCanon.GetPossessionsOfOwner(city))
            {
                if (!cell.SuppressSlot && cell.WorkerSlot.IsOccupied)
                {
                    retval += GetYieldOfCellForCity(cell, city);
                }
            }

            foreach (var building in BuildingPossessionCanon.GetPossessionsOfOwner(city))
            {
                retval += GetYieldOfBuildingForCity(building, city);
            }

            retval += GetYieldOfUnemployedPersonForCity(city) * UnemploymentLogic.GetUnemployedPeopleInCity(city);

            return(retval * (YieldSummary.Ones + additionalBonuses));
        }
        public override void Refresh()
        {
            if (ObjectToDisplay == null)
            {
                return;
            }

            UnemployedPeopleField.text = UnemploymentLogic.GetUnemployedPeopleInCity(ObjectToDisplay).ToString();
        }
Example #3
0
        private void AssignAndLockUnoccupiedSlot(IWorkerSlot slot)
        {
            if (UnemploymentLogic.GetUnemployedPeopleInCity(ObjectToDisplay) <= 0)
            {
                FreeUpSomeSlot();
            }

            slot.IsOccupied = true;
            slot.IsLocked   = true;
        }