Ejemplo n.º 1
0
    public virtual void Update()
    {
        if (DeleteStarted)
        {
            return;
        }

        RemoveList.Clear();
        RemoveList = SimpleTimers.ToList().Where(tmr => tmr?.IsCompleted).Select(tmr => {
            SimpleTimers.Remove(tmr);
            return(tmr);
        }).ToList();

        if (PlayerObjects.Count > 0)
        {
            Time = 60000;
        }

        if (Closeable && PlayerObjects.Count == 0 && !(this is Realm))
        {
            Time -= 1000 / Program.Manager.LogicTicker.TPS;

            if (Time <= 0)
            {
                Time = 60000;
                Delete();  // another method whose i'm clueless what is this
            }
        }

        HandleObjects();
    }
Ejemplo n.º 2
0
    public virtual void Update()
    {
        if (DeleteStarted)
        {
            return;         //delete tolereance
        }
        RemoveList.Clear(); //Handle timers
        RemoveList = SimpleTimers.ToList().Where(x => x != null && x.Update()).ToList();

        if (RemoveList.Count > 0)
        {
            foreach (SimpleTimer timer in RemoveList)
            {
                try {
                    SimpleTimers.Remove(timer);
                } catch { }
            }
        }

        if (PlayerObjects.Count > 0)
        {
            Time = 60000;
        }

        if (Closeable && PlayerObjects.Count == 0 && !(this is Realm))
        {
            Time -= 1000 / Program.Manager.LogicTicker.TPS;

            if (Time <= 0)
            {
                Time = 60000;
                Delete();
            }
        }

        HandleObjects();
    }