![]() |
Botcraft 1.21.4
|
#include <AssetsManager.hpp>
Public Member Functions | |
AssetsManager (AssetsManager const &)=delete | |
void | operator= (AssetsManager const &)=delete |
const std::unordered_map< int, std::unique_ptr< Blockstate > > & | Blockstates () const |
const Blockstate * | GetBlockstate (const BlockstateId id) const |
const Blockstate * | GetBlockstate (const std::string &name) const |
Get the first blockstate found with a given name. | |
const std::unordered_map< int, std::unique_ptr< Biome > > & | Biomes () const |
const Biome * | GetBiome (const int id) const |
const std::unordered_map< ItemId, std::unique_ptr< Item > > & | Items () const |
const Item * | GetItem (const ItemId id) const |
const Item * | GetItem (const std::string &item_name) const |
ItemId | GetItemID (const std::string &item_name) const |
const Renderer::Atlas * | GetAtlas () const |
Static Public Member Functions | |
static AssetsManager & | getInstance () |
Private Member Functions | |
AssetsManager () | |
void | LoadBlocksFile () |
void | FlattenBlocks () |
void | LoadBiomesFile () |
void | LoadItemsFile () |
void | LoadTextures () |
void | ClearCaches () |
void | UpdateModelsWithAtlasData () |
Private Attributes | |
std::unordered_map< int, std::unique_ptr< Blockstate > > | blockstates |
std::vector< const Blockstate * > | flattened_blockstates |
size_t | flattened_blockstates_size |
std::unordered_map< int, std::unique_ptr< Biome > > | biomes |
std::unordered_map< ItemId, std::unique_ptr< Item > > | items |
std::unique_ptr< Renderer::Atlas > | atlas |
Definition at line 19 of file AssetsManager.hpp.
|
delete |
|
private |
Definition at line 28 of file AssetsManager.cpp.
References atlas, ClearCaches(), LoadBiomesFile(), LoadBlocksFile(), LoadItemsFile(), LoadTextures(), LOG_FATAL, LOG_INFO, and UpdateModelsWithAtlasData().
const std::unordered_map< int, std::unique_ptr< Biome > > & Botcraft::AssetsManager::Biomes | ( | ) | const |
Definition at line 136 of file AssetsManager.cpp.
const std::unordered_map< int, std::unique_ptr< Blockstate > > & Botcraft::AssetsManager::Blockstates | ( | ) | const |
Definition at line 62 of file AssetsManager.cpp.
|
private |
Definition at line 1097 of file AssetsManager.cpp.
References Botcraft::Model::ClearCache(), and Botcraft::Blockstate::ClearCache().
Referenced by AssetsManager().
|
private |
Definition at line 841 of file AssetsManager.cpp.
References blockstates, flattened_blockstates, flattened_blockstates_size, and LOG_ERROR.
Referenced by LoadBlocksFile().
const Renderer::Atlas * Botcraft::AssetsManager::GetAtlas | ( | ) | const |
Definition at line 214 of file AssetsManager.cpp.
References atlas.
Referenced by Botcraft::Renderer::WorldRenderer::InitGL(), and Botcraft::Entity::InitializeFaces().
const Biome * Botcraft::AssetsManager::GetBiome | ( | const int | id | ) | const |
Definition at line 145 of file AssetsManager.cpp.
Referenced by Botcraft::Chunk::GetBiome().
const Blockstate * Botcraft::AssetsManager::GetBlockstate | ( | const BlockstateId | id | ) | const |
Definition at line 68 of file AssetsManager.cpp.
References blockstates, flattened_blockstates, and flattened_blockstates_size.
Referenced by Botcraft::Chunk::GetBlock(), Botcraft::World::GetBlockImpl(), and Botcraft::PrimedTntEntity::PrimedTntEntity().
const Blockstate * Botcraft::AssetsManager::GetBlockstate | ( | const std::string & | name | ) | const |
Get the first blockstate found with a given name.
name | Name of the blockstate |
Definition at line 109 of file AssetsManager.cpp.
References blockstates, flattened_blockstates, and Botcraft::Blockstate::GetName().
|
static |
Definition at line 21 of file AssetsManager.cpp.
Referenced by Botcraft::CraftImpl(), Botcraft::CraftNamedImpl(), Botcraft::DigImpl(), Botcraft::EyeOfEnderEntity::EyeOfEnderEntity(), Botcraft::FireballEntity::FireballEntity(), Botcraft::FireworkRocketEntity::FireworkRocketEntity(), Botcraft::Chunk::GetBiome(), Botcraft::Chunk::GetBlock(), Botcraft::World::GetBlockImpl(), Botcraft::HasItemInInventory(), Botcraft::HasItemInInventoryBlackboard(), Botcraft::Renderer::WorldRenderer::InitGL(), Botcraft::Entity::InitializeFaces(), Botcraft::ManagersClient::ManagersClient(), Botcraft::PhysicsManager::PhysicsManager(), Botcraft::InventoryManager::PrepareTransaction(), Botcraft::PrimedTntEntity::PrimedTntEntity(), Botcraft::Renderer::RenderingManager::Run(), Botcraft::SetItemInHand(), Botcraft::SetItemInHandBlackboard(), Botcraft::SnowballEntity::SnowballEntity(), Botcraft::SortInventory(), Botcraft::ThrownEggEntity::ThrownEggEntity(), Botcraft::ThrownEnderpearlEntity::ThrownEnderpearlEntity(), Botcraft::ThrownExperienceBottleEntity::ThrownExperienceBottleEntity(), Botcraft::ThrownPotionEntity::ThrownPotionEntity(), Botcraft::TradeImpl(), and Botcraft::TradeNameImpl().
Definition at line 164 of file AssetsManager.cpp.
References items.
Referenced by Botcraft::DigImpl(), and Botcraft::PhysicsManager::PhysicsManager().
const Item * Botcraft::AssetsManager::GetItem | ( | const std::string & | item_name | ) | const |
Definition at line 184 of file AssetsManager.cpp.
References items.
ItemId Botcraft::AssetsManager::GetItemID | ( | const std::string & | item_name | ) | const |
Definition at line 196 of file AssetsManager.cpp.
References items.
Referenced by Botcraft::CraftNamedImpl(), Botcraft::EyeOfEnderEntity::EyeOfEnderEntity(), Botcraft::FireballEntity::FireballEntity(), Botcraft::FireworkRocketEntity::FireworkRocketEntity(), Botcraft::HasItemInInventory(), Botcraft::SetItemInHand(), Botcraft::SetItemInHandBlackboard(), Botcraft::SnowballEntity::SnowballEntity(), Botcraft::ThrownEggEntity::ThrownEggEntity(), Botcraft::ThrownEnderpearlEntity::ThrownEnderpearlEntity(), Botcraft::ThrownExperienceBottleEntity::ThrownExperienceBottleEntity(), Botcraft::ThrownPotionEntity::ThrownPotionEntity(), and Botcraft::TradeNameImpl().
const std::unordered_map< ItemId, std::unique_ptr< Item > > & Botcraft::AssetsManager::Items | ( | ) | const |
Definition at line 159 of file AssetsManager.cpp.
References items.
Referenced by Botcraft::CraftImpl(), Botcraft::InventoryManager::PrepareTransaction(), Botcraft::Renderer::RenderingManager::Run(), and Botcraft::SortInventory().
|
private |
Definition at line 864 of file AssetsManager.cpp.
References Botcraft::Badlands, biomes, Botcraft::Classic, Botcraft::ColdOcean, Botcraft::DarkForest, Botcraft::FrozenOcean, ProtocolCraft::Json::Value::get_array(), ProtocolCraft::Json::Value::is_array(), LOG_ERROR, Botcraft::LukewarmOcean, Botcraft::PaleGarden, Botcraft::Swamp, and Botcraft::WarmOcean.
Referenced by AssetsManager().
|
private |
Definition at line 280 of file AssetsManager.cpp.
References Botcraft::BlockstateProperties::air, Botcraft::BlockstateProperties::bed, Botcraft::BlockstateProperties::berry_bush, blockstates, Botcraft::BlockstateProperties::climbable, Botcraft::BlockstateProperties::cobweb, ProtocolCraft::Json::Value::contains(), Botcraft::BlockstateProperties::custom, Botcraft::BlockstateProperties::down_bubble_column, Botcraft::Utilities::EndsWith(), FlattenBlocks(), ProtocolCraft::Json::Value::get(), ProtocolCraft::Json::Value::get_array(), ProtocolCraft::Json::Value::get_object(), ProtocolCraft::Json::Value::get_string(), Botcraft::Model::GetModel(), Botcraft::GetToolMaterialFromString(), Botcraft::GetToolTypeFromString(), Botcraft::Grass, Botcraft::BlockstateProperties::hazardous, Botcraft::BlockstateProperties::honey, Botcraft::BlockstateProperties::id, ProtocolCraft::Json::Value::is_array(), ProtocolCraft::Json::Value::is_object(), Botcraft::BlockstateProperties::lava, Botcraft::Leaves, LOG_ERROR, LOG_WARNING, Botcraft::BestTool::min_material, Botcraft::BestTool::multiplier, Botcraft::None, Botcraft::BlockstateProperties::path, Botcraft::BlockstateProperties::powder_snow, Botcraft::Redstone, Botcraft::BlockstateProperties::scaffolding, Botcraft::Shears, ProtocolCraft::Json::Value::size(), Botcraft::BlockstateProperties::slime, Botcraft::BlockstateProperties::solid, Botcraft::BlockstateProperties::soul_sand, Botcraft::Sword, Botcraft::BlockstateProperties::tint_type, Botcraft::BestTool::tool_type, Botcraft::BlockstateProperties::transparent, Botcraft::BlockstateProperties::up_bubble_column, Botcraft::BlockstateProperties::variables, Botcraft::Water, Botcraft::BlockstateProperties::water, Botcraft::BlockstateProperties::waterlogged, and Botcraft::Wood.
Referenced by AssetsManager().
|
private |
Definition at line 962 of file AssetsManager.cpp.
References ProtocolCraft::Json::Value::get_object(), items, and LOG_ERROR.
Referenced by AssetsManager().
|
private |
Definition at line 1044 of file AssetsManager.cpp.
References atlas, and blockstates.
Referenced by AssetsManager().
|
delete |
|
private |
Definition at line 1104 of file AssetsManager.cpp.
References atlas, and Botcraft::Blockstate::UpdateModelsWithAtlasData().
Referenced by AssetsManager().
|
private |
Definition at line 88 of file AssetsManager.hpp.
Referenced by AssetsManager(), GetAtlas(), LoadTextures(), and UpdateModelsWithAtlasData().
|
private |
Definition at line 84 of file AssetsManager.hpp.
Referenced by LoadBiomesFile().
|
private |
Definition at line 77 of file AssetsManager.hpp.
Referenced by FlattenBlocks(), GetBlockstate(), GetBlockstate(), LoadBlocksFile(), and LoadTextures().
|
private |
Definition at line 78 of file AssetsManager.hpp.
Referenced by FlattenBlocks(), GetBlockstate(), and GetBlockstate().
|
private |
Definition at line 79 of file AssetsManager.hpp.
Referenced by FlattenBlocks(), and GetBlockstate().
Definition at line 86 of file AssetsManager.hpp.
Referenced by GetItem(), GetItem(), GetItemID(), Items(), and LoadItemsFile().