Skip to content

Commit

Permalink
fix: compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Sep 28, 2024
1 parent 1dd99eb commit 971f43d
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 71 deletions.
1 change: 0 additions & 1 deletion src/creatures/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ target_sources(${PROJECT_NAME}_lib PRIVATE
players/cyclopedia/player_badge.cpp
players/cyclopedia/player_cyclopedia.cpp
players/cyclopedia/player_title.cpp
players/gamestore/player_store_detail.cpp
players/wheel/player_wheel.cpp
players/wheel/wheel_gems.cpp
players/vocations/vocation.cpp
Expand Down
37 changes: 0 additions & 37 deletions src/creatures/players/gamestore/player_store_detail.cpp

This file was deleted.

30 changes: 0 additions & 30 deletions src/creatures/players/gamestore/player_store_detail.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include "enums/account_group_type.hpp"
#include "enums/player_blessings.hpp"
#include "creatures/creatures_definitions.hpp"
#include "creatures/players/gamestore/player_store_detail.hpp"
#include "creatures/players/player_store_detail.hpp"

MuteCountMap Player::muteCountMap;

Expand Down
42 changes: 42 additions & 0 deletions src/creatures/players/player_store_detail.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

#pragma once

#include "kv/value_wrapper_proto.hpp"

class ValueWrapper;

#ifndef USE_PRECOMPILED_HEADERS
#include <string>
#include <cstdint>
#endif

struct StoreDetail {

std::string toString() const {
return fmt::format("Description: {}, Coin Amount: {}, CreatedAt: {}, Is Gold: {}", description, coinAmount, createdAt, isGold);
}

ValueWrapper serialize() const {
return {
{ "description", description },
{ "coinAmount", coinAmount },
{ "created_at", createdAt },
{ "is_gold", isGold }
};
}

static StoreDetail deserialize(const ValueWrapper &val) {
auto map = val.get<MapType>();
return {
map["description"]->get<StringType>(),
map["coinAmount"]->get<IntType>(),
map["created_at"]->get<IntType>(),
map["is_gold"]->get<BooleanType>()
};
}

std::string description;
int32_t coinAmount {};
int createdAt {};
bool isGold {};
};
2 changes: 1 addition & 1 deletion src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "creatures/players/cyclopedia/player_badge.hpp"
#include "creatures/players/cyclopedia/player_cyclopedia.hpp"
#include "creatures/players/cyclopedia/player_title.hpp"
#include "creatures/players/gamestore/player_store_detail.hpp"
#include "creatures/players/player_store_detail.hpp"
#include "creatures/npcs/npc.hpp"
#include "server/network/webhook/webhook.hpp"
#include "server/network/protocol/protocollogin.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "server/network/protocol/protocolgame.hpp"
#include "game/scheduling/dispatcher.hpp"
#include "creatures/combat/spells.hpp"
#include "creatures/players/gamestore/player_store_detail.hpp"
#include "creatures/players/player_store_detail.hpp"
#include "utils/tools.hpp"
#include "creatures/players/management/waitlist.hpp"
#include "items/weapons/weapons.hpp"
Expand Down

0 comments on commit 971f43d

Please sign in to comment.