Пример #1
0
    public void UpdateService(float deltaTime)
    {
        if (ServicedCharacter != null)
        {
            serviceDuration -= deltaTime;

            ServicedCharacter.Needs[NeedFulfilled] -= NeedFulfillmentPerSecond * deltaTime;
            if (ServicedCharacter.Needs[NeedFulfilled] < 0f)
            {
                ServicedCharacter.Needs[NeedFulfilled] = 0f;
            }

            if (ServicedCharacter.Needs[NeedFulfilled] <= 0f && serviceDuration <= 0f)
            {
                ServicedCharacter.ServiceEnded();
                serviceDuration   = Prototype.ServiceDuration;
                ServicedCharacter = null;
                reservation       = null;
            }
        }
        else
        {
            reservationTimer -= deltaTime;
            if (reservationTimer <= 0f)
            {
                if (reservation != null)
                {
                    reservation.ServiceEnded();
                    reservation = null;
                }
            }
        }
    }
Пример #2
0
 public void StartDeconstructionPreparation()
 {
     if (ServicedCharacter != null)
     {
         ServicedCharacter.InterruptActivity();
         ServicedCharacter = null;
     }
     haltedForDeconstruction = true;
     reservation             = null;
     serviceDuration         = Prototype.ServiceDuration;
     InputStorage.StartDeconstructionPreparation();
 }