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, ".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:27
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:28
ArchetypeLoader
Definition: ArchetypeLoader.h:22
Utils.h
ArchetypeLoader::load
virtual void load(BufferReader *reader, const std::string &filename) override
Definition: ArchetypeLoader.cpp:27
AssetsTracker.h
ArchetypeLoader::m_archetypes
Archetypes * m_archetypes
Definition: ArchetypeLoader.h:33
Utils::endsWith
static bool endsWith(const std::string &str, const std::string &with)
Definition: Utils.cpp:16
BufferReader
Definition: bufferreader.c:21
ArchetypeLoader::m_tracker
AssetsTracker * m_tracker
Definition: ArchetypeLoader.h:34
ArchetypeLoader::ArchetypeLoader
ArchetypeLoader(Archetypes *archetypes, AssetsTracker *tracker)
Definition: ArchetypeLoader.cpp:24
AssetLoader.h