#pragma region CPL License /* Nuclex Native Framework Copyright (C) 2002-2013 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #ifndef NUCLEX_GAME_STATES_ASPECT_H #define NUCLEX_GAME_STATES_ASPECT_H #include "Nuclex/Game/Config.h" #include "Nuclex/Game/States/GameStateManager.h" #include #include namespace Nuclex { namespace Game { namespace States { // ------------------------------------------------------------------------------------------- // class GameState; // forward declaration so we don't need the header class GameStateManager; // forward declaration so we don't need the header // ------------------------------------------------------------------------------------------- // /// Game state manager with a configurable messaging to its states /// Interface by which the aspect accesses game states /// /// /// Depending on your game's general design, your game states will have different kinds /// of notifications they need to receive. A game using a scene graph that may require /// game states to populate the scene graph upon activation and to remove their objects /// again upon deactivation. /// /// /// Aspects allow you to handle one such aspect of game states. The aforementioned /// scene graph notifications might become part of a SceneGraphAspect which will forward /// those notifications once added to the extensible game state manager. /// /// template class Aspect { friend GameStateManager; /// Active game states that support the aspect public: std::vector ActiveStates; /// Destroys the game aspect public: virtual ~Aspect() {} protected: virtual void OnGameStateEntered(const GameState &gameState) { } protected: virtual void OnGameStateExiting(const GameState &gameState) { } }; // ------------------------------------------------------------------------------------------- // }}} // namespace Nuclex::Game::States #endif // NUCLEX_GAME_STATES_ASPECT_H