TriEngine  v0.0.16
General-purpose engine in C#/OpenGL
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
TriDevs.TriEngine.StateManagement.IGameState Interface Reference

A game state that can be used with the game state manager. Represent a specific state of the game, like main menu and options screen. More...

Inheritance diagram for TriDevs.TriEngine.StateManagement.IGameState:
[legend]
Collaboration diagram for TriDevs.TriEngine.StateManagement.IGameState:
[legend]

Public Member Functions

void Load ()
 Loads resources associated with this game component. More...
 
void Unload ()
 Unloads resources that were loaded in the Load method. More...
 
void Pause ()
 Pauses the game state, preventing update calls from running. More...
 
void Unpause ()
 Unpauses the game state, enabling update calls again. More...
 
IGameComponent AddComponent (IGameComponent component)
 Adds a game component to this game state. More...
 
void RemoveComponent (IGameComponent component)
 Removes the specified component from this game state. More...
 
void RemoveAllComponents ()
 Removes all components from the game state. More...
 
void RemoveAllComponents (Type type)
 Removes all components of the specified type from the game state. More...
 
void RemoveAllComponents (Predicate< IGameComponent > predicate)
 Removes all components that match the supplied predicate function. More...
 
bool HasComponent (IGameComponent component)
 Returns whether this game state contains the specified IGameComponent. More...
 
bool HasComponent (Type type)
 Returns whether this game state contains a specific type of component. More...
 
bool HasComponent (Func< IGameComponent, bool > func)
 Returns whether this game state contains a component that matches the supplied predicate. More...
 
IEnumerable< IGameComponentGetAllComponents ()
 Returns a read-only collection of all components in this game state. More...
 
IGameComponent GetComponent (Type type)
 Returns the specified component type if it exists in this game state. More...
 
IEnumerable< IGameComponentGetAllComponents (Type type)
 Returns all components of the specified type. More...
 
IGameComponent GetComponent (Func< IGameComponent, bool > func)
 Returns the first component that matches the supplied predicate function. More...
 
IEnumerable< IGameComponentGetAllComponents (Func< IGameComponent, bool > func)
 Returns all components that matches the supplied predicate function. More...
 
- Public Member Functions inherited from TriDevs.TriEngine.Interfaces.IDrawable
void Draw ()
 Draw the object to screen. More...
 
- Public Member Functions inherited from TriDevs.TriEngine.Interfaces.IUpdatable
void Update ()
 Updates the object. More...
 

Properties

bool Paused [get, set]
 Gets or sets a value indicating whether this game state is currently paused. More...
 

Detailed Description

A game state that can be used with the game state manager. Represent a specific state of the game, like main menu and options screen.

Member Function Documentation

IGameComponent TriDevs.TriEngine.StateManagement.IGameState.AddComponent ( IGameComponent  component)

Adds a game component to this game state.

Parameters
componentThe component to add.
Returns
The component that was added.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

IEnumerable<IGameComponent> TriDevs.TriEngine.StateManagement.IGameState.GetAllComponents ( )

Returns a read-only collection of all components in this game state.

Returns
Read-only collection of components.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

IEnumerable<IGameComponent> TriDevs.TriEngine.StateManagement.IGameState.GetAllComponents ( Type  type)

Returns all components of the specified type.

Parameters
typeThe type of game component requested.
Returns
A collection of all components of matching type.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

IEnumerable<IGameComponent> TriDevs.TriEngine.StateManagement.IGameState.GetAllComponents ( Func< IGameComponent, bool >  func)

Returns all components that matches the supplied predicate function.

Parameters
funcThe predicate function.
Returns
Collection of all matching components, empty collection if no matches were found.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

IGameComponent TriDevs.TriEngine.StateManagement.IGameState.GetComponent ( Type  type)

Returns the specified component type if it exists in this game state.

Parameters
typeThe component type to get.
Returns
The component object, or null if it's not added to this game state.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

IGameComponent TriDevs.TriEngine.StateManagement.IGameState.GetComponent ( Func< IGameComponent, bool >  func)

Returns the first component that matches the supplied predicate function.

Parameters
funcThe predicate function.
Returns
Component that matches the predicate, null if no matches were found.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

bool TriDevs.TriEngine.StateManagement.IGameState.HasComponent ( IGameComponent  component)

Returns whether this game state contains the specified IGameComponent.

Parameters
componentThe component to check for.
Returns
True if the component has been added to this game state, false otherwise.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

bool TriDevs.TriEngine.StateManagement.IGameState.HasComponent ( Type  type)

Returns whether this game state contains a specific type of component.

Parameters
typeThe type to check for.
Returns
True if the type of component has been added to this game state, false otherwise.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

bool TriDevs.TriEngine.StateManagement.IGameState.HasComponent ( Func< IGameComponent, bool >  func)

Returns whether this game state contains a component that matches the supplied predicate.

Parameters
funcPredicate function to use for search.
Returns
True if the game state contains a matching component, false otherwise.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

void TriDevs.TriEngine.StateManagement.IGameState.Load ( )

Loads resources associated with this game component.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

Here is the caller graph for this function:

void TriDevs.TriEngine.StateManagement.IGameState.Pause ( )

Pauses the game state, preventing update calls from running.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

Here is the caller graph for this function:

void TriDevs.TriEngine.StateManagement.IGameState.RemoveAllComponents ( )

Removes all components from the game state.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

void TriDevs.TriEngine.StateManagement.IGameState.RemoveAllComponents ( Type  type)

Removes all components of the specified type from the game state.

Parameters
typeThe type of component to remove.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

void TriDevs.TriEngine.StateManagement.IGameState.RemoveAllComponents ( Predicate< IGameComponent predicate)

Removes all components that match the supplied predicate function.

Parameters
predicateThe predicate function.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

void TriDevs.TriEngine.StateManagement.IGameState.RemoveComponent ( IGameComponent  component)

Removes the specified component from this game state.

Parameters
component

Implemented in TriDevs.TriEngine.StateManagement.GameState.

void TriDevs.TriEngine.StateManagement.IGameState.Unload ( )

Unloads resources that were loaded in the Load method.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

Here is the caller graph for this function:

void TriDevs.TriEngine.StateManagement.IGameState.Unpause ( )

Unpauses the game state, enabling update calls again.

Implemented in TriDevs.TriEngine.StateManagement.GameState.

Property Documentation

bool TriDevs.TriEngine.StateManagement.IGameState.Paused
getset

Gets or sets a value indicating whether this game state is currently paused.


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