Crossfire Server, Trunk  R22010
ResourcesManager.h
Go to the documentation of this file.
1 #ifndef RESOURCESMANAGER_H
2 #define RESOURCESMANAGER_H
3 
4 extern "C" {
5 #include "global.h"
6 #include "object.h"
7 }
8 #include "AssetsTracker.h"
9 
10 class CREMapInformation;
12 
20 };
21 
22 typedef std::function<bool(ArchetypeUse use, const archt*, const treasurelist*, const CREMapInformation*, recipe*)> AssetUseCallback;
23 
24 class ResourcesManager : public AssetsTracker<archt>
25 {
26  public:
28  virtual ~ResourcesManager();
29 
30  void load();
31 
32  int recipeMaxIngredients() const;
33  QStringList recipes(int count) const;
34  const recipestruct* recipe(int ingredients, const QString& name) const;
35 
36  virtual void assetDefined(const archt *arch, const std::string &filename);
37 
38  const QHash<QString, QList<const archt*> >& origins() const { return myOrigins; }
39 
40  static void archetypeUse(const archt* item, CREMapInformationManager* store, AssetUseCallback callback);
41 
42  protected:
43  QHash<QString, QList<const archt*> > myOrigins;
44  QList<QHash<QString, recipestruct*> > myRecipes;
45 };
46 
47 #endif /* RESOURCESMANAGER_H */
QList< QHash< QString, recipestruct * > > myRecipes
QStringList recipes(int count) const
std::function< bool(ArchetypeUse use, const archt *, const treasurelist *, const CREMapInformation *, recipe *)> AssetUseCallback
virtual void assetDefined(const archt *arch, const std::string &filename)
QHash< QString, QList< const archt * > > myOrigins
const QHash< QString, QList< const archt * > > & origins() const
const recipestruct * recipe(int ingredients, const QString &name) const
ArchetypeUse
static void archetypeUse(const archt *item, CREMapInformationManager *store, AssetUseCallback callback)
virtual ~ResourcesManager()
int recipeMaxIngredients() const