forked from jaildesigner-jailgames/jaildoctors_dilemma
style: organitzada la capçalera de Room
This commit is contained in:
@@ -164,7 +164,7 @@ auto Resource::getTileMap(const std::string& name) -> std::vector<int>& {
|
||||
}
|
||||
|
||||
// Obtiene la habitación a partir de un nombre
|
||||
auto Resource::getRoom(const std::string& name) -> std::shared_ptr<RoomData> {
|
||||
auto Resource::getRoom(const std::string& name) -> std::shared_ptr<Room::Data> {
|
||||
auto it = std::ranges::find_if(rooms_, [&name](const auto& r) { return r.name == name; });
|
||||
|
||||
if (it != rooms_.end()) {
|
||||
@@ -278,7 +278,7 @@ void Resource::loadTileMaps() {
|
||||
|
||||
for (const auto& l : list) {
|
||||
auto name = getFileName(l);
|
||||
tile_maps_.emplace_back(name, loadRoomTileFile(l));
|
||||
tile_maps_.emplace_back(name, Room::loadRoomTileFile(l));
|
||||
printWithDots("TileMap : ", name, "[ LOADED ]");
|
||||
updateLoadingProgress();
|
||||
}
|
||||
@@ -292,7 +292,7 @@ void Resource::loadRooms() {
|
||||
|
||||
for (const auto& l : list) {
|
||||
auto name = getFileName(l);
|
||||
rooms_.emplace_back(name, std::make_shared<RoomData>(loadRoomFile(l)));
|
||||
rooms_.emplace_back(name, std::make_shared<Room::Data>(Room::loadRoomFile(l)));
|
||||
printWithDots("Room : ", name, "[ LOADED ]");
|
||||
updateLoadingProgress();
|
||||
}
|
||||
@@ -300,7 +300,7 @@ void Resource::loadRooms() {
|
||||
|
||||
void Resource::createText() {
|
||||
struct ResourceInfo {
|
||||
std::string key; // Identificador del recurso
|
||||
std::string key; // Identificador del recurso
|
||||
std::string texture_file; // Nombre del archivo de textura
|
||||
std::string text_file; // Nombre del archivo de texto
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ struct ResourceAnimation {
|
||||
|
||||
// Estructura para almacenar ficheros con el mapa de tiles de una habitación y su nombre
|
||||
struct ResourceTileMap {
|
||||
std::string name; // Nombre del mapa de tiles
|
||||
std::string name; // Nombre del mapa de tiles
|
||||
std::vector<int> tile_map; // Vector con los indices del mapa de tiles
|
||||
|
||||
// Constructor
|
||||
@@ -102,11 +102,11 @@ struct ResourceTileMap {
|
||||
|
||||
// Estructura para almacenar habitaciones y su nombre
|
||||
struct ResourceRoom {
|
||||
std::string name; // Nombre de la habitación
|
||||
std::shared_ptr<RoomData> room; // Habitación
|
||||
std::string name; // Nombre de la habitación
|
||||
std::shared_ptr<Room::Data> room; // Habitación
|
||||
|
||||
// Constructor
|
||||
ResourceRoom(std::string name, std::shared_ptr<RoomData> room)
|
||||
ResourceRoom(std::string name, std::shared_ptr<Room::Data> room)
|
||||
: name(std::move(name)),
|
||||
room(std::move(std::move(room))) {}
|
||||
};
|
||||
@@ -248,7 +248,7 @@ class Resource {
|
||||
auto getTileMap(const std::string& name) -> std::vector<int>&;
|
||||
|
||||
// Obtiene la habitación a partir de un nombre
|
||||
auto getRoom(const std::string& name) -> std::shared_ptr<RoomData>;
|
||||
auto getRoom(const std::string& name) -> std::shared_ptr<Room::Data>;
|
||||
|
||||
// Obtiene todas las habitaciones
|
||||
auto getRooms() -> std::vector<ResourceRoom>&;
|
||||
|
||||
Reference in New Issue
Block a user