Crossfire Server, Trunk
GameSounds.h
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2022 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 GAME_SOUNDS_H
14 #define GAME_SOUNDS_H
15 
16 #include <vector>
17 #include "assets/AssetWrapper.h"
18 
19 class GameSound;
20 
21 class GameSounds : public AssetWrapper {
22  Q_OBJECT
23 
24  Q_PROPERTY(QString description READ description)
25 public:
26  GameSounds(AssetWrapper *parent);
27 
28  virtual QString displayName() const override { return tr("Game sounds"); }
29  virtual int childrenCount() const override{ return static_cast<int>(mySounds.size()); }
30  virtual AssetWrapper *child(int child) override;
31  virtual int childIndex(AssetWrapper *child) override;
32  virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override;
33 
34  QString description() const;
35 
36  static std::map<QString, std::string> gameSounds;
37 
38 private:
39  std::vector<GameSound *> mySounds;
40 };
41 
42 #endif /* GAME_SOUNDS_H */
AssetWrapper.h
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:32
GameSounds
Definition: GameSounds.h:21
GameSound
Definition: GameSound.h:18
GameSounds::GameSounds
GameSounds(AssetWrapper *parent)
Definition: GameSounds.cpp:43
GameSounds::gameSounds
static std::map< QString, std::string > gameSounds
Definition: GameSounds.h:36
AssetWrapper
Definition: AssetWrapper.h:25
GameSounds::childIndex
virtual int childIndex(AssetWrapper *child) override
Definition: GameSounds.cpp:62
GameSounds::description
QString description
Definition: GameSounds.h:24
GameSounds::displayName
virtual QString displayName() const override
Definition: GameSounds.h:28
GameSounds::child
virtual AssetWrapper * child(int child) override
Definition: GameSounds.cpp:58
GameSounds::childrenCount
virtual int childrenCount() const override
Definition: GameSounds.h:29
GameSounds::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition: GameSounds.cpp:50
GameSounds::mySounds
std::vector< GameSound * > mySounds
Definition: GameSounds.h:39