Пример #1
0
        public override void UpdateScene()
        {
            if (_upgradeScreenActive)
            {
                _upgradeInterface.Update();
            }

            else if (_learnSpellScreenActive)
            {
                _learnSpellInterface.Update();
            }

            else if (_spellbookScreenActive)
            {
                _spellbookInterface.Update();
            }

            else if (_gameOver)
            {
                if (Input.LastTCODKeyPressed.KeyCode == libtcod.TCODKeyCode.Enter)
                {
                    _game.GameOver();
                }
            }

            else
            {
                bool fxPlaying = false;
                //Update special effects
                for (int i = 0; i < _specialEffects.Count; i++)
                {
                    SpecialEffect effect = _gameObjectPool.GetSpecialEffect(_specialEffects[i]);

                    if (effect == null || !effect.Alive)
                    {
                        _specialEffects.RemoveAt(i);
                        i--;
                    }
                    else if (effect.Awake)
                    {
                        fxPlaying = true;
                        effect.Update();
                    }
                }
                if (!fxPlaying)
                {
                    //If there are no special effects playing, update the turn counter
                    _turnCounter.Update();
                }
            }
        }