Example #1
0
        public void Update(float deltaTime)
        {
            if (NextSyncTime >= 10 * 1000)
            {
                Send(new GameTimerMessage(0, GameTime / 1000f));
                NextSyncTime = 0;
            }

            BlueTeam.Update(deltaTime);
            PurpleTeam.Update(deltaTime);
            NeutralTeam.Update(deltaTime);
            Map.Update(deltaTime);


            DelayedActions.RemoveAll(x => x.Finalized);

            foreach (var action in DelayedActions)
            {
                action.Update(deltaTime);
            }

            foreach (var unit in UnitsToRemove)
            {
                Map.RemoveUnit(unit);
                unit.Team.RemoveUnit(unit);
                unit.DefineTeam(null);
                unit.DefineGame(null);
                unit.Disposed       = true;
                unit.PendingDispose = false;
            }

            UnitsToRemove.Clear();
        }
Example #2
0
        public void Update(float deltaTime)
        {
            if (NextSyncTime >= 10 * 1000)
            {
                Send(new GameTimerMessage(0, GameTime / 1000f));
                NextSyncTime = 0;
            }


            BlueTeam.Update(deltaTime);
            PurpleTeam.Update(deltaTime);
            NeutralTeam.Update(deltaTime);
            Map.Update(deltaTime);

            foreach (var unit in UnitsToRemove)
            {
                Map.RemoveUnit(unit);
                unit.Team.RemoveUnit(unit);
                unit.DefineTeam(null);
                unit.DefineGame(null);
            }

            UnitsToRemove.Clear();
        }