3 #include "engine/game_state.h"
4 #include "engine/typedefs.h"
10 #include <luabind/object.hpp>
12 class btDiscreteDynamicsWorld;
36 class ComponentFactory;
42 class OgreViewportSystem;
43 class CollisionSystem;
133 std::vector<std::unique_ptr<System>> systems,
135 std::string guiLayoutName
172 const std::string& name
377 soundManager()
const;
454 EntityId oldEntityId,
487 struct Implementation;
488 std::unique_ptr<Implementation> m_impl;
std::function< void()> Initializer
Typedef for the game state's initializer function.
Definition: game_state.h:48
void registerConsoleObject(luabind::object consoleObject)
Registers the console object.
Definition: engine.cpp:983
int getResolutionWidth() const
Returns the width of the games window.
Definition: engine.cpp:953
const Keyboard & keyboard() const
Returns the keyboard interface.
Definition: engine.cpp:683
void resumeGame()
Resumes system updates of the game.
Definition: engine.cpp:583
Random Number Generator.
Definition: rng.h:19
void init()
Initializes the engine.
Definition: engine.cpp:652
bool isSystemTimedShutdown(System &system) const
Returns whether the specified system has already been set for a timed shutdown.
Definition: engine.cpp:971
void shutdown()
Shuts the engine down.
Definition: engine.cpp:867
RNG & rng()
The engine's RNG.
Definition: engine.cpp:632
EntityId transferEntityGameState(EntityId oldEntityId, EntityManager *oldEntityManager, GameState *newGameState)
Transfers an entity from one gamestate to another.
Definition: engine.cpp:890
static luabind::scope luaBindings()
Lua bindings.
Definition: engine.cpp:547
std::string getCreationFileList(std::string stage) const
Obtains a list of filenames for saved creations that match the provided type.
Definition: engine.cpp:828
void screenShot(std::string path)
Takes a screenshot.
Definition: engine.cpp:821
Engine()
Constructor.
Definition: engine.cpp:587
Manages entities and their components.
Definition: entity_manager.h:23
A factory for components.
Definition: component_factory.h:19
Handles keyboard events.
Definition: keyboard.h:24
Handles mouse events.
Definition: mouse.h:28
A system handles one specific part of the game.
Definition: system.h:23
void load(std::string filename)
Loads a savegame.
Definition: engine.cpp:689
ComponentFactory & componentFactory()
Returns the internal component factory.
Definition: engine.cpp:597
void save(std::string filename)
Creates a savegame.
Definition: engine.cpp:736
PlayerData & playerData()
Object holding generic player data.
Definition: engine.cpp:862
void timedSystemShutdown(System &system, int milliseconds)
Keeps a system alive after being shut down for a specified amount of time.
Definition: engine.cpp:963
void saveCreation(EntityId entityId, const EntityManager &entityManager, std::string name, std::string type) const
Saves a creation to file.
Definition: engine.cpp:752
void pauseGame()
Pauses system updates of the game.
Definition: engine.cpp:578
Definition: sound_manager.h:15
Definition: player_data.h:18
void setCurrentGameState(GameState *gameState)
Sets the current game state.
Definition: engine.cpp:847
void update(int milliseconds)
Renders a single frame.
Definition: engine.cpp:908
const std::string & thriveVersion() const
Gets the current version of thrive as a string.
Definition: engine.cpp:978
Definition: bullet_to_ogre_system.h:5
Definition: bullet_ogre_conversion.h:6
lua_State * luaState()
The script engine's Lua state.
Definition: engine.cpp:713
GameState * createGameState(std::string name, std::vector< std::unique_ptr< System >> systems, GameState::Initializer initializer, std::string guiLayoutName)
Creates a new game state.
Definition: engine.cpp:603
Ogre::RenderWindow * renderWindow() const
The render window.
Definition: engine.cpp:730
Represents a distinct set of active systems and entities.
Definition: game_state.h:41
Definition: debug_drawing.h:8
const Mouse & mouse() const
Returns the mouse interface.
Definition: engine.cpp:718
GameState * currentGameState() const
Returns the currently active game state.
Definition: engine.cpp:627
OIS::InputManager * inputManager() const
The engine's input manager.
Definition: engine.cpp:677
void quit()
Request the game to close.
Definition: engine.cpp:880
~Engine()
Destructor.
Definition: engine.cpp:593
The heart of the game.
Definition: engine.h:55
GameState * getGameState(const std::string &name) const
Retrieves a game state.
Definition: engine.cpp:638
int getResolutionHeight() const
Returns the width of the games window.
Definition: engine.cpp:958
EntityId loadCreation(std::string file, EntityManager &entityManager)
Loads a creation from file.
Definition: engine.cpp:798
Ogre::Root * ogreRoot() const
The Ogre root object.
Definition: engine.cpp:724
bool fileExists(std::string filePath)
checks if a file exists
Definition: engine.cpp:697