Crossfire Server  1.75.0
FacesetLoader.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 FACESETLOADER_H
14 #define FACESETLOADER_H
15 
16 #include "AssetLoader.h"
17 #include "Utils.h"
18 
19 class Facesets;
20 
21 class FacesetLoader : public AssetLoader {
22 public:
23  FacesetLoader(Facesets *facesets);
24 
25  virtual bool willLoad(const std::string &filename) override {
26  return Utils::endsWith(filename.c_str(), "/image_info");
27  }
28 
29  virtual void load(BufferReader *reader, const std::string &filename) override;
30 
31 private:
33 };
34 
35 #endif /* FACESETLOADER_H */
36 
static bool endsWith(const char *const str, const char *const with)
Checks if a string ends with another one.
Definition: Utils.cpp:16
virtual void load(BufferReader *reader, const std::string &filename) override
Load assets from the specified reader.
virtual bool willLoad(const std::string &filename) override
Whether this instance will process or not the specified file.
Definition: FacesetLoader.h:25
Facesets * m_facesets
Definition: FacesetLoader.h:32
Available facesets for clients.
Definition: Facesets.h:23
FacesetLoader(Facesets *facesets)
Abstract buffer handler, processing a BufferReader.
Definition: AssetLoader.h:24