Manages loading and caching of custom object binary files. More...
#include <custom_object.h>
Public Member Functions | |
| void | Initialize (const std::string &custom_objects_folder) |
| absl::StatusOr< std::shared_ptr< CustomObject > > | LoadObject (const std::string &filename) |
| absl::StatusOr< std::shared_ptr< CustomObject > > | GetObjectInternal (int object_id, int subtype) |
| int | GetSubtypeCount (int object_id) const |
| void | ReloadAll () |
Static Public Member Functions | |
| static CustomObjectManager & | Get () |
Private Member Functions | |
| CustomObjectManager ()=default | |
| absl::StatusOr< CustomObject > | ParseBinaryData (const std::vector< uint8_t > &data) |
Private Attributes | |
| std::string | base_path_ |
| std::unordered_map< std::string, std::shared_ptr< CustomObject > > | cache_ |
Static Private Attributes | |
| static const std::vector< std::string > | kSubtype1Filenames |
| static const std::vector< std::string > | kSubtype2Filenames |
Manages loading and caching of custom object binary files.
Definition at line 47 of file custom_object.h.
|
privatedefault |
|
static |
Definition at line 37 of file custom_object.cc.
Referenced by yaze::zelda3::ObjectDrawer::DrawCustomObject(), yaze::zelda3::ObjectDrawer::DrawObject(), yaze::editor::DungeonObjectSelector::DrawObjectAssetBrowser(), and yaze::editor::DungeonEditorV2::Load().
| void yaze::zelda3::CustomObjectManager::Initialize | ( | const std::string & | custom_objects_folder | ) |
Definition at line 42 of file custom_object.cc.
References base_path_, and cache_.
Referenced by yaze::editor::DungeonEditorV2::Load().
| absl::StatusOr< std::shared_ptr< CustomObject > > yaze::zelda3::CustomObjectManager::LoadObject | ( | const std::string & | filename | ) |
Definition at line 47 of file custom_object.cc.
References base_path_, cache_, LOG_ERROR, and ParseBinaryData().
Referenced by GetObjectInternal().

| absl::StatusOr< std::shared_ptr< CustomObject > > yaze::zelda3::CustomObjectManager::GetObjectInternal | ( | int | object_id, |
| int | subtype ) |
Definition at line 135 of file custom_object.cc.
References kSubtype1Filenames, kSubtype2Filenames, and LoadObject().

| int yaze::zelda3::CustomObjectManager::GetSubtypeCount | ( | int | object_id | ) | const |
Definition at line 168 of file custom_object.cc.
References kSubtype1Filenames, and kSubtype2Filenames.
| void yaze::zelda3::CustomObjectManager::ReloadAll | ( | ) |
Definition at line 176 of file custom_object.cc.
References cache_.
|
private |
Definition at line 77 of file custom_object.cc.
References LOG_WARN, and yaze::zelda3::CustomObject::tiles.
Referenced by LoadObject().
|
private |
Definition at line 73 of file custom_object.h.
Referenced by Initialize(), and LoadObject().
|
private |
Definition at line 74 of file custom_object.h.
Referenced by Initialize(), LoadObject(), and ReloadAll().
|
staticprivate |
Definition at line 77 of file custom_object.h.
Referenced by GetObjectInternal(), and GetSubtypeCount().
|
staticprivate |
Definition at line 79 of file custom_object.h.
Referenced by GetObjectInternal(), and GetSubtypeCount().