GetAt() public method

Gets the model at index
public GetAt ( int index ) : ImageModel
index int
return SmashBros.Models.ImageModel
Ejemplo n.º 1
0
        public override void OnNext(GameStateManager value)
        {
            ImageController animateIn = null, animateOut = null;

            switch (value.PreviousState)
            {
            case GameState.StartScreen:
                if (value.CurrentState != GameState.StartScreen)
                {
                    animateOut = startScreen;
                    RemoveView(tipsText);
                }
                break;

            case GameState.CharacterMenu:
                CharacterSelectionVisible = false;
                break;

            case GameState.MapsMenu:
                MapSelectionVisible = false;
                break;

            case GameState.GameOver:
                GameStatsVisible      = false;
                continueText.Position = new Vector2(250, 320);
                foreach (var pad in GamePadControllers)
                {
                    pad.PlayerModel.SelectedCharacter = null;
                }
                break;
            }

            switch (value.CurrentState)
            {
            case GameState.StartScreen:
                startScreen.IsVisible = true;
                animateOut            = selectionScreen;
                animateIn             = startScreen;
                AddView(tipsText);
                break;

            case GameState.CharacterMenu:
                selectionScreen.IsVisible = true;
                if (value.PreviousState != GameState.MapsMenu)
                {
                    animateIn = selectionScreen;
                }
                //Loads the sounds for the menu
                CharacterSelectionVisible = true;

                Screen.soundController.PlaySound("Menu/chooseCharacter");
                break;

            case GameState.MapsMenu:
                selectionScreen.IsVisible = true;
                //if selection screen not has position
                //then the gameplay has exited to mapselection
                if (selectionScreen.GetAt(0) == null)
                {
                    animateIn = selectionScreen;
                }
                MapSelectionVisible = true;
                break;

            case GameState.GamePlay:
                AddController(new GamePlayController(Screen, selectedMap));
                DisposeController(this);

                break;

            case GameState.GamePause:
                break;

            case GameState.GameOver:
                selectionScreen.IsVisible = true;
                animateIn        = selectionScreen;
                GameStatsVisible = true;
                Screen.popupMenuController.Disabled = false;
                break;
            }

            if (animateIn != null)
            {
                animateIn.Layer = 2;
                animateIn.SetPosition(-1280, 0);
                animateIn.AnimatePos(0, 0, 600, false);
            }
            if (animateOut != null)
            {
                animateOut.Layer = 1;
                animateOut.SetPosition(0, 0);
                animateOut.AnimatePos(1280, 0, 600, false);
            }
        }