Beispiel #1
0
        public void Update(IGameState gameState)
        {
            // menu order
            switch (NavigatingTo)
            {
            case 0:
                _router.RouteTo("Help");
                break;

            case 1:
                _router.RouteTo("Credits");
                break;

            case 2:
                _router.RouteTo("Reload");
                break;
            }
        }
        public void Update(IGameState gameState)
        {
            // menu order
            switch (NavigatingTo)
            {
            case 0:
                _router.RouteTo("Title");
                break;

            case 1:
                _router.RouteTo("Reading");
                break;

            case 2:
                _router.RouteTo("Setting");
                break;
            }
            CurrentState = _router.CurrentState.Name;
        }
Beispiel #3
0
        public void Update(List <IGameComponent> components, IGameState gameState)
        {
            IShowState currentState = _router.CurrentState;

            foreach (IGameComponent component in components)
            {
                bool previousActiveState = (component.IsActive == true);
                if (component.IsActive)
                {
                    component.Update(gameState);
                }
                // update active status
                if (component.ActiveUnderState == "Root" || currentState.IsCalled(component.ActiveUnderState))
                {
                    component.IsActive = true;
                }
                else
                {
                    component.IsActive = false;
                }
                // specific cases
                if (component is StoryComponent)
                {
                    if (component.IsActive)
                    {
                        if ((component as StoryComponent).Choosing)
                        {
                            _router.RouteTo("Reading/Choosing");
                            _router.SetRedirect("Reading", 1);
                        }
                        _refreshEditing = (component as StoryComponent).NewConversation;
                        _currLine       = (component as StoryComponent).CurrentLine;
                    }
                }
                if (component is ChoiceComponent)
                {
                    if (component.IsActive)
                    {
                        if ((component as ChoiceComponent).Chosen)
                        {
                            _router.RouteTo("Reading/Story");
                            _router.SetRedirect("Reading", 0);
                        }
                    }
                }
                if (component is PersonalityComponent)
                {
                    if (_refreshEditing)
                    {
                        (component as PersonalityComponent).RefreshActive();
                    }
                }
                if (component is GraphicComponent)
                {
                    (component as GraphicComponent).CurrentLine = _currLine;
                }
                // setup if reactivated
                if (component.IsActive && !previousActiveState)
                {
                    component.Setup(gameState);
                }
            }
        }