Crossfire Server, Trunk  1.75.0
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:
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
All archetypes in the game.
Definition: Archetypes.h:23
archetypes
in that case they will be relative to whatever the PWD of the crossfire server process is You probably shouldn though Notes on Specific and settings file datadir Usually usr share crossfire Contains data that the server does not need to modify while such as the archetypes
Definition: server-directories.txt:45
ArchetypeLoader::willLoad
virtual bool willLoad(const std::string &filename) override
Whether this instance will process or not the specified file.
Definition: ArchetypeLoader.h:26
AssetLoader
Abstract buffer handler, processing a BufferReader.
Definition: AssetLoader.h:24
AssetsTracker
Base class to be informed of where an asset is defined.
Definition: AssetsTracker.h:24
ArchetypeLoader
Definition: ArchetypeLoader.h:22
Utils.h
ArchetypeLoader::load
virtual void load(BufferReader *reader, const std::string &filename) override
Load assets from the specified reader.
Definition: ArchetypeLoader.cpp:23
AssetsTracker.h
ArchetypeLoader::m_archetypes
Archetypes * m_archetypes
Definition: ArchetypeLoader.h:33
BufferReader
Definition: bufferreader.cpp:22
ArchetypeLoader::m_tracker
AssetsTracker * m_tracker
Definition: ArchetypeLoader.h:34
Utils::endsWith
static bool endsWith(const char *const str, const char *const with)
Checks if a string ends with another one.
Definition: Utils.cpp:16
ArchetypeLoader::ArchetypeLoader
ArchetypeLoader(Archetypes *archetypes, AssetsTracker *tracker)
Definition: ArchetypeLoader.cpp:20
AssetLoader.h