1#ifndef YAZE_ZELDA3_DUNGEON_CUSTOM_OBJECT_H_
2#define YAZE_ZELDA3_DUNGEON_CUSTOM_OBJECT_H_
8#include <unordered_map>
10#include "absl/status/status.h"
11#include "absl/status/statusor.h"
39 std::vector<TileMapEntry>
tiles;
53 void Initialize(
const std::string& custom_objects_folder);
56 absl::StatusOr<std::shared_ptr<CustomObject>>
LoadObject(
const std::string& filename);
60 absl::StatusOr<std::shared_ptr<CustomObject>>
GetObjectInternal(
int object_id,
int subtype);
71 absl::StatusOr<CustomObject>
ParseBinaryData(
const std::vector<uint8_t>& data);
74 std::unordered_map<std::string, std::shared_ptr<CustomObject>>
cache_;
Manages loading and caching of custom object binary files.
int GetSubtypeCount(int object_id) const
absl::StatusOr< CustomObject > ParseBinaryData(const std::vector< uint8_t > &data)
static CustomObjectManager & Get()
absl::StatusOr< std::shared_ptr< CustomObject > > LoadObject(const std::string &filename)
CustomObjectManager()=default
absl::StatusOr< std::shared_ptr< CustomObject > > GetObjectInternal(int object_id, int subtype)
static const std::vector< std::string > kSubtype2Filenames
void Initialize(const std::string &custom_objects_folder)
std::unordered_map< std::string, std::shared_ptr< CustomObject > > cache_
static const std::vector< std::string > kSubtype1Filenames
Represents a decoded custom object (from binary format)
std::vector< TileMapEntry > tiles