Crossfire Server, Trunk
MessageLoader.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 MESSAGELOADER_H
14 #define MESSAGELOADER_H
15 
16 #include "AssetLoader.h"
17 #include "Utils.h"
18 
19 class Messages;
20 class AssetsTracker;
21 
22 class MessageLoader : public AssetLoader {
23 public:
25 
26  virtual bool willLoad(const std::string &filename) override {
27  return Utils::endsWith(filename, "/messages");
28  }
29 
30  virtual void load(BufferReader *reader, const std::string &filename) override;
31 
32 private:
35 };
36 
37 #endif /* MESSAGELOADER_H */
38 
MessageLoader::m_tracker
AssetsTracker * m_tracker
Definition: MessageLoader.h:34
MessageLoader::MessageLoader
MessageLoader(Messages *messages, AssetsTracker *tracker)
Definition: MessageLoader.cpp:23
MessageLoader::m_messages
Messages * m_messages
Definition: MessageLoader.h:33
Messages
Definition: Messages.h:24
AssetLoader
Definition: AssetLoader.h:24
npc_dialog.filename
filename
Definition: npc_dialog.py:99
AssetsTracker
Definition: AssetsTracker.h:28
Utils.h
navar-midane_apply.messages
list messages
Definition: navar-midane_apply.py:8
MessageLoader
Definition: MessageLoader.h:22
MessageLoader::willLoad
virtual bool willLoad(const std::string &filename) override
Definition: MessageLoader.h:26
Utils::endsWith
static bool endsWith(const std::string &str, const std::string &with)
Definition: Utils.cpp:16
MessageLoader::load
virtual void load(BufferReader *reader, const std::string &filename) override
Definition: MessageLoader.cpp:26
BufferReader
Definition: bufferreader.c:21
AssetLoader.h