![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
#include <LevelManager.h>
Collaboration diagram for Olympe::Editor::LevelManager:Public Member Functions | |
| LevelManager () | |
| ~LevelManager () | |
| bool | LoadLevel (const std::string &path) |
| bool | SaveLevel (const std::string &path) |
| void | NewLevel (const std::string &name) |
| EntityInstance * | CreateEntity (const std::string &prefabPath) |
| void | DeleteEntity (const std::string &id) |
| EntityInstance * | GetEntity (const std::string &id) const |
| std::vector< EntityInstance * > | GetAllEntities () |
| bool | UpdateEntityPosition (const std::string &id, const Vector &position) |
| void | SetTile (int x, int y, int tileId) |
| int | GetTile (int x, int y) const |
| void | ResizeTileMap (int width, int height) |
| void | SetCollision (int x, int y, uint8_t mask) |
| uint8_t | GetCollision (int x, int y) const |
| void | ResizeCollisionMap (int width, int height) |
| const LevelDefinition & | GetLevelDefinition () const |
| LevelDefinition & | GetLevelDefinition () |
| const std::string & | GetCurrentLevelPath () const |
| bool | HasUnsavedChanges () const |
| void | MarkDirty () |
| void | ClearDirty () |
Private Member Functions | |
| void | SerializeToJson (json &j) const |
| bool | DeserializeFromJson (const json &j) |
| std::string | GenerateUniqueEntityId () |
| std::string | GetCurrentTimestamp () |
Private Attributes | |
| LevelDefinition | m_levelDef |
| std::string | m_currentPath |
| bool | m_hasUnsavedChanges |
| int | m_nextEntityId |
Definition at line 213 of file LevelManager.h.
| Olympe::Editor::LevelManager::LevelManager | ( | ) |
Definition at line 78 of file LevelManager.cpp.
| Olympe::Editor::LevelManager::~LevelManager | ( | ) |
Definition at line 83 of file LevelManager.cpp.
|
inline |
Definition at line 248 of file LevelManager.h.
References m_hasUnsavedChanges.
| EntityInstance * Olympe::Editor::LevelManager::CreateEntity | ( | const std::string & | prefabPath | ) |
Definition at line 406 of file LevelManager.cpp.
References Olympe::Editor::LevelDefinition::entities, GenerateUniqueEntityId(), GetComponentTypeID_Static(), m_hasUnsavedChanges, and m_levelDef.
Here is the call graph for this function:Definition at line 422 of file LevelManager.cpp.
References Olympe::Editor::LevelDefinition::entities, GetComponentTypeID_Static(), m_hasUnsavedChanges, and m_levelDef.
Here is the call graph for this function:Definition at line 266 of file LevelManager.cpp.
References Olympe::Editor::LevelDefinition::ambientColor, Olympe::Editor::LevelMetadata::author, Olympe::Editor::LevelDefinition::backgroundMusic, Olympe::Editor::LevelDefinition::blueprintType, Olympe::Editor::LevelDefinition::collisionMap, Olympe::Editor::LevelMetadata::created, Olympe::Editor::LevelDefinition::description, Olympe::Editor::LevelDefinition::editorState, Olympe::Editor::LevelDefinition::entities, Olympe::Editor::from_json(), GetComponentTypeID_Static(), Olympe::Editor::LevelMetadata::lastModified, Olympe::Editor::LevelDefinition::levelName, m_levelDef, m_nextEntityId, Olympe::Editor::LevelDefinition::metadata, Olympe::Editor::LevelDefinition::name, Olympe::Editor::LevelDefinition::schema_version, Olympe::Editor::EditorStateData::scrollOffset, Olympe::Editor::LevelMetadata::tags, Olympe::Editor::LevelDefinition::tileMap, Olympe::Editor::LevelDefinition::type, Olympe::Editor::LevelDefinition::worldSize, and Olympe::Editor::EditorStateData::zoom.
Referenced by LoadLevel().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 104 of file LevelManager.cpp.
References GetComponentTypeID_Static(), and m_nextEntityId.
Referenced by CreateEntity().
Here is the call graph for this function:
Here is the caller graph for this function:| std::vector< EntityInstance * > Olympe::Editor::LevelManager::GetAllEntities | ( | ) |
Definition at line 448 of file LevelManager.cpp.
References Olympe::Editor::LevelDefinition::entities, GetComponentTypeID_Static(), and m_levelDef.
Here is the call graph for this function:Definition at line 519 of file LevelManager.cpp.
References Olympe::Editor::LevelDefinition::collisionMap, and m_levelDef.
|
inline |
Definition at line 245 of file LevelManager.h.
References m_currentPath.
|
private |
Definition at line 87 of file LevelManager.cpp.
References GetComponentTypeID_Static().
Referenced by NewLevel(), and SaveLevel().
Here is the call graph for this function:
Here is the caller graph for this function:| EntityInstance * Olympe::Editor::LevelManager::GetEntity | ( | const std::string & | id | ) | const |
Definition at line 436 of file LevelManager.cpp.
References Olympe::Editor::LevelDefinition::entities, and m_levelDef.
Referenced by UpdateEntityPosition().
Here is the caller graph for this function:
|
inline |
Definition at line 243 of file LevelManager.h.
References m_levelDef.
|
inline |
Definition at line 242 of file LevelManager.h.
References m_levelDef.
Definition at line 484 of file LevelManager.cpp.
References m_levelDef, and Olympe::Editor::LevelDefinition::tileMap.
|
inline |
Definition at line 246 of file LevelManager.h.
References m_hasUnsavedChanges.
Definition at line 129 of file LevelManager.cpp.
References DeserializeFromJson(), GetComponentTypeID_Static(), m_currentPath, and m_hasUnsavedChanges.
Here is the call graph for this function:
|
inline |
Definition at line 247 of file LevelManager.h.
References m_hasUnsavedChanges.
Definition at line 111 of file LevelManager.cpp.
References Olympe::Editor::LevelMetadata::author, Olympe::Editor::LevelMetadata::created, GetCurrentTimestamp(), Olympe::Editor::LevelMetadata::lastModified, Olympe::Editor::LevelDefinition::levelName, m_currentPath, m_hasUnsavedChanges, m_levelDef, m_nextEntityId, Olympe::Editor::LevelDefinition::metadata, Olympe::Editor::LevelDefinition::name, ResizeCollisionMap(), and ResizeTileMap().
Here is the call graph for this function:Definition at line 529 of file LevelManager.cpp.
References Olympe::Editor::LevelDefinition::collisionMap, m_hasUnsavedChanges, and m_levelDef.
Referenced by NewLevel().
Here is the caller graph for this function:Definition at line 494 of file LevelManager.cpp.
References m_hasUnsavedChanges, m_levelDef, and Olympe::Editor::LevelDefinition::tileMap.
Referenced by NewLevel().
Here is the caller graph for this function:Definition at line 165 of file LevelManager.cpp.
References GetComponentTypeID_Static(), GetCurrentTimestamp(), Olympe::Editor::LevelMetadata::lastModified, m_currentPath, m_hasUnsavedChanges, m_levelDef, Olympe::Editor::LevelDefinition::metadata, and SerializeToJson().
Here is the call graph for this function:Definition at line 196 of file LevelManager.cpp.
References Olympe::Editor::LevelDefinition::ambientColor, Olympe::Editor::LevelMetadata::author, Olympe::Editor::LevelDefinition::backgroundMusic, Olympe::Editor::LevelDefinition::blueprintType, Olympe::Editor::LevelDefinition::collisionMap, Olympe::Editor::LevelMetadata::created, Olympe::Editor::LevelDefinition::description, Olympe::Editor::LevelDefinition::editorState, Olympe::Editor::LevelDefinition::entities, GetComponentTypeID_Static(), Olympe::Editor::LevelMetadata::lastModified, Olympe::Editor::LevelDefinition::levelName, m_levelDef, Olympe::Editor::LevelDefinition::metadata, Olympe::Editor::LevelDefinition::name, Olympe::Editor::LevelDefinition::schema_version, Olympe::Editor::EditorStateData::scrollOffset, Olympe::Editor::LevelMetadata::tags, Olympe::Editor::LevelDefinition::tileMap, Olympe::Editor::to_json(), Olympe::Editor::LevelDefinition::type, Olympe::Editor::LevelDefinition::worldSize, and Olympe::Editor::EditorStateData::zoom.
Referenced by SaveLevel().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 509 of file LevelManager.cpp.
References Olympe::Editor::LevelDefinition::collisionMap, GetComponentTypeID_Static(), m_hasUnsavedChanges, and m_levelDef.
Here is the call graph for this function:Definition at line 474 of file LevelManager.cpp.
References GetComponentTypeID_Static(), m_hasUnsavedChanges, m_levelDef, and Olympe::Editor::LevelDefinition::tileMap.
Here is the call graph for this function:| bool Olympe::Editor::LevelManager::UpdateEntityPosition | ( | const std::string & | id, |
| const Vector & | position | ||
| ) |
Definition at line 458 of file LevelManager.cpp.
References GetEntity(), m_hasUnsavedChanges, and Olympe::Editor::EntityInstance::position.
Here is the call graph for this function:
|
private |
Definition at line 259 of file LevelManager.h.
Referenced by GetCurrentLevelPath(), LoadLevel(), NewLevel(), and SaveLevel().
|
private |
Definition at line 260 of file LevelManager.h.
Referenced by ClearDirty(), CreateEntity(), DeleteEntity(), HasUnsavedChanges(), LoadLevel(), MarkDirty(), NewLevel(), ResizeCollisionMap(), ResizeTileMap(), SaveLevel(), SetCollision(), SetTile(), and UpdateEntityPosition().
|
private |
Definition at line 258 of file LevelManager.h.
Referenced by CreateEntity(), DeleteEntity(), DeserializeFromJson(), GetAllEntities(), GetCollision(), GetEntity(), GetLevelDefinition(), GetLevelDefinition(), GetTile(), NewLevel(), ResizeCollisionMap(), ResizeTileMap(), SaveLevel(), SerializeToJson(), SetCollision(), and SetTile().
|
private |
Definition at line 261 of file LevelManager.h.
Referenced by DeserializeFromJson(), GenerateUniqueEntityId(), and NewLevel().