Crossfire Server, Trunk
ArchetypeLoader.h
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2020-2021 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #ifndef ARCHETYPELOADER_H
14 #define ARCHETYPELOADER_H
15 
16 #include "AssetLoader.h"
17 #include "Utils.h"
18 #include "AssetsTracker.h"
19 
20 class Archetypes;
21 
22 class ArchetypeLoader : public AssetLoader {
23 public:
24  ArchetypeLoader(Archetypes *archetypes, AssetsTracker *tracker);
25 
26  virtual bool willLoad(const std::string &filename) override {
27  return Utils::endsWith(filename.c_str(), ".arc");
28  }
29 
30  virtual void load(BufferReader *reader, const std::string& filename) override;
31 
32 private:
35 };
36 
37 #endif /* ARCHETYPELOADER_H */
38 
Archetypes
Definition: Archetypes.h:23
ArchetypeLoader::willLoad
virtual bool willLoad(const std::string &filename) override
Definition: ArchetypeLoader.h:26
AssetLoader
Definition: AssetLoader.h:24
npc_dialog.filename
filename
Definition: npc_dialog.py:99
AssetsTracker
Definition: AssetsTracker.h:26
ArchetypeLoader
Definition: ArchetypeLoader.h:22
Utils.h
ArchetypeLoader::load
virtual void load(BufferReader *reader, const std::string &filename) override
Definition: ArchetypeLoader.cpp:23
AssetsTracker.h
ArchetypeLoader::m_archetypes
Archetypes * m_archetypes
Definition: ArchetypeLoader.h:33
BufferReader
Definition: bufferreader.cpp:21
ArchetypeLoader::m_tracker
AssetsTracker * m_tracker
Definition: ArchetypeLoader.h:34
Utils::endsWith
static bool endsWith(const char *const str, const char *const with)
Definition: Utils.cpp:16
ArchetypeLoader::ArchetypeLoader
ArchetypeLoader(Archetypes *archetypes, AssetsTracker *tracker)
Definition: ArchetypeLoader.cpp:20
AssetLoader.h