Skip to content

Commit

Permalink
Fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
f0n1x authored and killerwife committed Feb 4, 2024
1 parent 8c55e0a commit 35c803c
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions src/game/Loot/LootMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,45 +258,6 @@ typedef std::vector<LootStoreItem> LootStoreItemList;
typedef std::unordered_map<uint32, LootTemplate> LootTemplateMap;
typedef std::set<uint32> LootIdSet;

class LootStore
{
public:
explicit LootStore(char const* name, char const* entryName, bool ratesAllowed)
: m_name(name), m_entryName(entryName), m_ratesAllowed(ratesAllowed) {}
virtual ~LootStore() { Clear(); }

void Verify() const;

void LoadAndCollectLootIds(LootIdSet& ids_set);
void LoadAndCheckReferenceNames();
bool CheckLootRefs(LootIdSet* ref_set = nullptr); // check existence reference and remove it from ref_set
void ReportUnusedIds(LootIdSet const& ids_set) const;
void ReportNotExistedId(uint32 id) const;

bool HaveLootFor(uint32 loot_id) const;
bool HaveQuestLootFor(uint32 loot_id) const;
bool HaveQuestLootForPlayer(uint32 loot_id, Player* player) const;

LootTemplate const* GetLootFor(uint32 loot_id) const;

char const* GetName() const { return m_name; }
char const* GetEntryName() const { return m_entryName; }
bool IsRatesAllowed() const { return m_ratesAllowed; }

// Checks if drop rules are valid for the item
bool IsValidItemTemplate(uint32 entry, uint32 itemId, uint32 group, int32 mincountOrRef, float chance, uint32 maxCount) const;

protected:
void LoadLootTable();
void Clear();

private:
LootTemplateMap m_LootTemplates;
char const* m_name;
char const* m_entryName;
bool m_ratesAllowed;
};

class LootTemplate
{
private:
Expand Down Expand Up @@ -345,6 +306,45 @@ class LootTemplate
LootGroups Groups; // groups have own (optimized) processing, grouped entries go there
};

class LootStore
{
public:
explicit LootStore(char const* name, char const* entryName, bool ratesAllowed)
: m_name(name), m_entryName(entryName), m_ratesAllowed(ratesAllowed) {}
virtual ~LootStore() { Clear(); }

void Verify() const;

void LoadAndCollectLootIds(LootIdSet& ids_set);
void LoadAndCheckReferenceNames();
bool CheckLootRefs(LootIdSet* ref_set = nullptr); // check existence reference and remove it from ref_set
void ReportUnusedIds(LootIdSet const& ids_set) const;
void ReportNotExistedId(uint32 id) const;

bool HaveLootFor(uint32 loot_id) const;
bool HaveQuestLootFor(uint32 loot_id) const;
bool HaveQuestLootForPlayer(uint32 loot_id, Player* player) const;

LootTemplate const* GetLootFor(uint32 loot_id) const;

char const* GetName() const { return m_name; }
char const* GetEntryName() const { return m_entryName; }
bool IsRatesAllowed() const { return m_ratesAllowed; }

// Checks if drop rules are valid for the item
bool IsValidItemTemplate(uint32 entry, uint32 itemId, uint32 group, int32 mincountOrRef, float chance, uint32 maxCount) const;

protected:
void LoadLootTable();
void Clear();

private:
LootTemplateMap m_LootTemplates;
char const* m_name;
char const* m_entryName;
bool m_ratesAllowed;
};

//=====================================================

ByteBuffer& operator<<(ByteBuffer& b, LootItem const& li);
Expand Down

0 comments on commit 35c803c

Please sign in to comment.