Midnight Blue Game and Engine
Public Member Functions | Properties | List of all members
MB2D.Scenes.SceneStack Class Reference

Holds the games scenes in a stack structure running the top scene every frame. Handles switching state for scenes and popping/pushing new scenes on top of one another. Allows the current scene to access other scenes. More...

Collaboration diagram for MB2D.Scenes.SceneStack:
Collaboration graph

Public Member Functions

 SceneStack ()
 Initializes a new instance of the T:MB2D.Scenes.SceneStack class. More...
 
void Push (Scene scene)
 Pushes a new scene to the top of the stack. Calls the new scenes Initialize method and the previous scenes Pause method More...
 
void Draw (SpriteBatch spriteBatch, SpriteBatch uiSpriteBatch)
 
void Update ()
 Updates the scene at the top of the stack and handles any state transitions if they've been called. For any transitions or scene logic to function correctly this must be called once per frame. More...
 
void Pop ()
 Pops the top scene off the stack, calling its Exit method and calls the Resume method of the next scene on the stack if it exists. More...
 
void ResetTo (Scene scene)
 Resets the scene stack to the specified scene, clearing all other scenes from the stack. Use this in most scenarios instead of Push to save memory by not keeping scenes allocated if unnecessary. More...
 
Scene SceneAt (int index)
 Gets the scene located at the specific index in the stack More...
 

Properties

Scene Top [get]
 Gets the scene at the top of the stack. More...
 
Scene Bottom [get]
 Gets the scene at the bottom of the stack. More...
 
int Size [get]
 Gets the current size of the stack More...
 
int LastIndex [get]
 Gets the upper bounds of the indexes of the stack More...
 
Scene Next [get]
 
Type LastSceneType [get]
 

Detailed Description

Holds the games scenes in a stack structure running the top scene every frame. Handles switching state for scenes and popping/pushing new scenes on top of one another. Allows the current scene to access other scenes.

Constructor & Destructor Documentation

§ SceneStack()

MB2D.Scenes.SceneStack.SceneStack ( )
inline

Initializes a new instance of the T:MB2D.Scenes.SceneStack class.

Member Function Documentation

§ Pop()

void MB2D.Scenes.SceneStack.Pop ( )
inline

Pops the top scene off the stack, calling its Exit method and calls the Resume method of the next scene on the stack if it exists.

Here is the call graph for this function:
Here is the caller graph for this function:

§ Push()

void MB2D.Scenes.SceneStack.Push ( Scene  scene)
inline

Pushes a new scene to the top of the stack. Calls the new scenes Initialize method and the previous scenes Pause method

Parameters
sceneScene to push.
Here is the caller graph for this function:

§ ResetTo()

void MB2D.Scenes.SceneStack.ResetTo ( Scene  scene)
inline

Resets the scene stack to the specified scene, clearing all other scenes from the stack. Use this in most scenarios instead of Push to save memory by not keeping scenes allocated if unnecessary.

Parameters
sceneScene to reset to.
Here is the caller graph for this function:

§ SceneAt()

Scene MB2D.Scenes.SceneStack.SceneAt ( int  index)
inline

Gets the scene located at the specific index in the stack

Returns
The T:MB2D.Scenes.Scene.
Parameters
indexIndex to get.
Here is the call graph for this function:
Here is the caller graph for this function:

§ Update()

void MB2D.Scenes.SceneStack.Update ( )
inline

Updates the scene at the top of the stack and handles any state transitions if they've been called. For any transitions or scene logic to function correctly this must be called once per frame.

Here is the caller graph for this function:

Property Documentation

§ Bottom

Scene MB2D.Scenes.SceneStack.Bottom
get

Gets the scene at the bottom of the stack.

The bottom scene.

§ LastIndex

int MB2D.Scenes.SceneStack.LastIndex
get

Gets the upper bounds of the indexes of the stack

The last index.

§ Size

int MB2D.Scenes.SceneStack.Size
get

Gets the current size of the stack

The size.

§ Top

Scene MB2D.Scenes.SceneStack.Top
get

Gets the scene at the top of the stack.

The scene at the top of the stack.


The documentation for this class was generated from the following file: