Crossfire Server, Trunk
ScriptFile.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 SCRIPT_FILE_H
14 #define SCRIPT_FILE_H
15 
16 #include <QList>
17 #include "assets/AssetWrapper.h"
19 
20 class CREMapInformation;
21 
26 public:
27  HookInformation(CREMapInformation* map, int x, int y, const QString& itemName, const QString& pluginName, const QString& eventName);
28 
29  const CREMapInformation* map() const;
30  int x() const;
31  int y() const;
32  QString itemName() const;
33  QString pluginName() const;
34  QString eventName() const;
35 
36 private:
38  int myX;
39  int myY;
40  QString myItemName;
41  QString myPluginName;
42  QString myEventName;
43 };
44 
48 class ScriptFile : public AssetWrapper {
49 public:
50  ScriptFile(AssetWrapper *parent, const QString& path);
51  virtual ~ScriptFile();
52 
53  virtual QString displayName() const override { return myPath; }
54 
55  void addHook(HookInformation* hook);
56  bool forMap(const CREMapInformation* map) const;
63  QList<HookInformation*> hooks() const;
64  const QString& path() const;
65 
66 private:
67  QString myPath;
68  QList<HookInformation*> myHooks;
69 };
70 
71 #endif /* SCRIPT_FILE_H */
HookInformation::x
int x() const
Definition: ScriptFile.cpp:86
ScriptFile::removeMap
bool removeMap(CREMapInformation *map)
Definition: ScriptFile.cpp:52
AssetWrapper.h
ScriptFile::forMap
bool forMap(const CREMapInformation *map) const
Definition: ScriptFile.cpp:30
HookInformation::myMap
CREMapInformation * myMap
Definition: ScriptFile.h:37
HookInformation::myItemName
QString myItemName
Definition: ScriptFile.h:40
HookInformation::map
const CREMapInformation * map() const
Definition: ScriptFile.cpp:81
ScriptFile::myHooks
QList< HookInformation * > myHooks
Definition: ScriptFile.h:68
HookInformation::itemName
QString itemName() const
Definition: ScriptFile.cpp:96
HookInformation::myY
int myY
Definition: ScriptFile.h:39
HookInformation::y
int y() const
Definition: ScriptFile.cpp:91
CREMapInformation
Definition: CREMapInformation.h:27
disinfect.map
map
Definition: disinfect.py:4
ScriptFile::path
const QString & path() const
Definition: ScriptFile.cpp:47
ScriptFile::displayName
virtual QString displayName() const override
Definition: ScriptFile.h:53
AssetWrapper
Definition: AssetWrapper.h:25
HookInformation::myEventName
QString myEventName
Definition: ScriptFile.h:42
HookInformation::pluginName
QString pluginName() const
Definition: ScriptFile.cpp:101
ScriptFile
Definition: ScriptFile.h:48
AssetWrapperPanel.h
ScriptFile::ScriptFile
ScriptFile(AssetWrapper *parent, const QString &path)
Definition: ScriptFile.cpp:16
HookInformation::HookInformation
HookInformation(CREMapInformation *map, int x, int y, const QString &itemName, const QString &pluginName, const QString &eventName)
Definition: ScriptFile.cpp:71
ScriptFile::addHook
void addHook(HookInformation *hook)
Definition: ScriptFile.cpp:25
HookInformation::myX
int myX
Definition: ScriptFile.h:38
HookInformation::myPluginName
QString myPluginName
Definition: ScriptFile.h:41
ScriptFile::myPath
QString myPath
Definition: ScriptFile.h:67
ScriptFile::hooks
QList< HookInformation * > hooks() const
Definition: ScriptFile.cpp:42
ScriptFile::~ScriptFile
virtual ~ScriptFile()
Definition: ScriptFile.cpp:20
HookInformation
Definition: ScriptFile.h:25
HookInformation::eventName
QString eventName() const
Definition: ScriptFile.cpp:106