private void CheckSlotForRefresh(IWorkerSlot slot)
 {
     if (slot == SlotToDisplay)
     {
         Refresh();
     }
 }
        private IHexCell BuildCell(IWorkerSlot slot)
        {
            var mockCells = new Mock <IHexCell>();

            mockCells.Setup(tile => tile.WorkerSlot).Returns(slot);
            AllCells.Add(mockCells.Object);

            return(mockCells.Object);
        }
        /// <inheritdoc/>
        public YieldSummary GetYieldMultipliersForSlot(IWorkerSlot slot)
        {
            if (slot == null)
            {
                throw new ArgumentNullException("slot");
            }

            return(YieldSummary.Empty);
        }
Пример #4
0
        private void AssignAndLockUnoccupiedSlot(IWorkerSlot slot)
        {
            if (UnemploymentLogic.GetUnemployedPeopleInCity(ObjectToDisplay) <= 0)
            {
                FreeUpSomeSlot();
            }

            slot.IsOccupied = true;
            slot.IsLocked   = true;
        }
 private static YieldSummary GetSlotYield(
     IWorkerSlot slot, ICity city, IYieldGenerationLogic generationLogic
     )
 {
     if (slot.ParentCell != null)
     {
         return(generationLogic.GetYieldOfCellForCity(slot.ParentCell, city));
     }
     else
     {
         return(generationLogic.GetYieldOfBuildingSlotsForCity(slot.ParentBuilding, city));
     }
 }
Пример #6
0
        private void OnSlotClicked(IWorkerSlot slot)
        {
            if (ObjectToDisplay == null)
            {
                return;
            }

            if (slot.IsOccupied && !slot.IsLocked)
            {
                LockOccupiedSlot(slot);
            }
            else if (slot.IsOccupied && slot.IsLocked)
            {
                UnassignLockedSlot(slot);
            }
            else
            {
                AssignAndLockUnoccupiedSlot(slot);
            }

            ObjectToDisplay.PerformDistribution();
        }
Пример #7
0
 private void UnassignLockedSlot(IWorkerSlot slot)
 {
     slot.IsOccupied = false;
     slot.IsLocked   = false;
 }
Пример #8
0
 private void LockOccupiedSlot(IWorkerSlot slot)
 {
     slot.IsLocked = true;
 }