Base GameState class that all other game states derive from, defines basic GameState behaviour.
More...
|
bool | Paused [get, set] |
|
bool | Paused [get, set] |
| Gets or sets a value indicating whether this game state is currently paused. More...
|
|
Base GameState class that all other game states derive from, defines basic GameState behaviour.
TriDevs.TriEngine.StateManagement.GameState.GameState |
( |
| ) |
|
|
protected |
Adds a game component to this game state.
- Parameters
-
component | The component to add. |
- Returns
- The component that was added.
Implements TriDevs.TriEngine.StateManagement.IGameState.
83 throw new InvalidOperationException(
"Cannot add the same component more than once.");
virtual void TriDevs.TriEngine.StateManagement.GameState.Draw |
( |
| ) |
|
|
virtual |
IEnumerable<IGameComponent> TriDevs.TriEngine.StateManagement.GameState.GetAllComponents |
( |
| ) |
|
IEnumerable<IGameComponent> TriDevs.TriEngine.StateManagement.GameState.GetAllComponents |
( |
Type |
type | ) |
|
Returns all components that matches the supplied predicate function.
- Parameters
-
func | The predicate function. |
- Returns
- Collection of all matching components, empty collection if no matches were found.
Implements TriDevs.TriEngine.StateManagement.IGameState.
IGameComponent TriDevs.TriEngine.StateManagement.GameState.GetComponent |
( |
Type |
type | ) |
|
Returns the specified component type if it exists in this game state.
- Parameters
-
type | The component type to get. |
- Returns
- The component object, or null if it's not added to this game state.
Implements TriDevs.TriEngine.StateManagement.IGameState.
143 return Components.FirstOrDefault(c => c.GetType() == type);
Returns the first component that matches the supplied predicate function.
- Parameters
-
func | The predicate function. |
- Returns
- Component that matches the predicate, null if no matches were found.
Implements TriDevs.TriEngine.StateManagement.IGameState.
bool TriDevs.TriEngine.StateManagement.GameState.HasComponent |
( |
IGameComponent |
component | ) |
|
Returns whether this game state contains the specified IGameComponent.
- Parameters
-
component | The component to check for. |
- Returns
- True if the component has been added to this game state, false otherwise.
Implements TriDevs.TriEngine.StateManagement.IGameState.
bool TriDevs.TriEngine.StateManagement.GameState.HasComponent |
( |
Type |
type | ) |
|
Returns whether this game state contains a specific type of component.
- Parameters
-
type | The type to check for. |
- Returns
- True if the type of component has been added to this game state, false otherwise.
Implements TriDevs.TriEngine.StateManagement.IGameState.
128 return Components.Any(c => c.GetType() == type);
bool TriDevs.TriEngine.StateManagement.GameState.HasComponent |
( |
Func< IGameComponent, bool > |
func | ) |
|
Returns whether this game state contains a component that matches the supplied predicate.
- Parameters
-
func | Predicate function to use for search. |
- Returns
- True if the game state contains a matching component, false otherwise.
Implements TriDevs.TriEngine.StateManagement.IGameState.
virtual void TriDevs.TriEngine.StateManagement.GameState.Load |
( |
| ) |
|
|
virtual |
virtual void TriDevs.TriEngine.StateManagement.GameState.Pause |
( |
| ) |
|
|
virtual |
void TriDevs.TriEngine.StateManagement.GameState.RemoveAllComponents |
( |
| ) |
|
void TriDevs.TriEngine.StateManagement.GameState.RemoveAllComponents |
( |
Type |
type | ) |
|
void TriDevs.TriEngine.StateManagement.GameState.RemoveAllComponents |
( |
Predicate< IGameComponent > |
predicate | ) |
|
Removes all components that match the supplied predicate function.
- Parameters
-
predicate | The predicate function. |
Implements TriDevs.TriEngine.StateManagement.IGameState.
114 if (removed.Count < 1)
118 removed.ForEach(c => c.Disable());
void TriDevs.TriEngine.StateManagement.GameState.RemoveComponent |
( |
IGameComponent |
component | ) |
|
virtual void TriDevs.TriEngine.StateManagement.GameState.Unload |
( |
| ) |
|
|
virtual |
virtual void TriDevs.TriEngine.StateManagement.GameState.Unpause |
( |
| ) |
|
|
virtual |
virtual void TriDevs.TriEngine.StateManagement.GameState.Update |
( |
| ) |
|
|
virtual |
readonly List<IGameComponent> TriDevs.TriEngine.StateManagement.GameState.Components |
|
protected |
List of components currently added to this GameState.
bool TriDevs.TriEngine.StateManagement.GameState.Paused |
|
getset |
The documentation for this class was generated from the following file: