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 
24 public:
25  HookInformation(CREMapInformation* map, int x, int y, const QString& itemName, const QString& pluginName, const QString& eventName);
26 
27  const CREMapInformation* map() const;
28  int x() const;
29  int y() const;
30  QString itemName() const;
31  QString pluginName() const;
32  QString eventName() const;
33 
34 private:
36  int myX;
37  int myY;
38  QString myItemName;
39  QString myPluginName;
40  QString myEventName;
41 };
42 
44 class ScriptFile : public AssetWrapper {
45 public:
46  ScriptFile(AssetWrapper *parent, const QString& path);
47  virtual ~ScriptFile();
48 
49  virtual QString displayName() const override { return myPath; }
50 
51  void addHook(HookInformation* hook);
52  bool forMap(const CREMapInformation* map) const;
59  QList<HookInformation*> hooks() const;
60  const QString& path() const;
61 
62 private:
63  QString myPath;
64  QList<HookInformation*> myHooks;
65 };
66 
67 #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:35
HookInformation::myItemName
QString myItemName
Definition: ScriptFile.h:38
HookInformation::map
const CREMapInformation * map() const
Definition: ScriptFile.cpp:81
ScriptFile::myHooks
QList< HookInformation * > myHooks
Definition: ScriptFile.h:64
HookInformation::itemName
QString itemName() const
Definition: ScriptFile.cpp:96
HookInformation::myY
int myY
Definition: ScriptFile.h:37
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:49
AssetWrapper
Definition: AssetWrapper.h:22
HookInformation::myEventName
QString myEventName
Definition: ScriptFile.h:40
HookInformation::pluginName
QString pluginName() const
Definition: ScriptFile.cpp:101
ScriptFile
Definition: ScriptFile.h:44
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:36
HookInformation::myPluginName
QString myPluginName
Definition: ScriptFile.h:39
ScriptFile::myPath
QString myPath
Definition: ScriptFile.h:63
ScriptFile::hooks
QList< HookInformation * > hooks() const
Definition: ScriptFile.cpp:42
ScriptFile::~ScriptFile
virtual ~ScriptFile()
Definition: ScriptFile.cpp:20
HookInformation
Definition: ScriptFile.h:23
HookInformation::eventName
QString eventName() const
Definition: ScriptFile.cpp:106