Crossfire Server, Trunk
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
v
w
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
i
j
k
m
n
o
p
r
s
t
u
v
Enumerations
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Enumerations
Enumerator
Properties
a
b
c
d
e
f
h
i
j
k
l
m
n
p
q
r
s
t
y
Related Functions
:
b
d
o
s
w
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
w
y
z
Typedefs
a
c
d
e
f
i
j
k
l
m
n
o
p
q
s
t
y
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
ScriptFileManager.cpp
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
#include "
ScriptFileManager.h
"
14
#include "
scripts/ScriptFile.h
"
15
#include <QVariant>
16
17
ScriptFileManager::ScriptFileManager
(
AssetWrapper
*parent) :
AssetWrapper
(parent) {
18
setProperty(
tipProperty
, tr(
"Display all Python scripts used in maps."
));
19
}
20
21
ScriptFileManager::~ScriptFileManager
()
22
{
23
qDeleteAll(
myScripts
.values());
24
}
25
26
QList<ScriptFile*>
ScriptFileManager::scriptsForMap
(
CREMapInformation
*
map
)
27
{
28
QList<ScriptFile*>
list
;
29
foreach
(
ScriptFile
* script,
myScripts
.values())
30
{
31
if
(script->
forMap
(
map
))
32
{
33
list
.append(script);
34
}
35
}
36
return
list
;
37
}
38
39
ScriptFile
*
ScriptFileManager::getFile
(
const
QString&
path
)
40
{
41
if
(!
myScripts
.contains(
path
))
42
{
43
markModified
(
BeforeChildAdd
,
myScripts
.size());
44
myScripts
.insert(
path
,
new
ScriptFile
(
this
,
path
));
45
markModified
(
AfterChildAdd
);
46
}
47
return
myScripts
[
path
];
48
}
49
50
void
ScriptFileManager::removeMap
(
CREMapInformation
*
map
)
51
{
52
QHash<QString, ScriptFile*>::iterator script =
myScripts
.begin();
53
while
(script !=
myScripts
.end())
54
{
55
if
((*script)->removeMap(
map
))
56
{
57
ScriptFile
* s = *script;
58
script =
myScripts
.erase(script);
59
delete
s;
60
}
61
else
62
{
63
script++;
64
}
65
}
66
}
67
68
QList<ScriptFile*>
ScriptFileManager::scripts
()
const
69
{
70
return
myScripts
.values();
71
}
72
73
void
ScriptFileManager::addHook
(
const
QString &
file
,
HookInformation
*hook) {
74
getFile
(
file
)->
addHook
(hook);
75
}
ScriptFileManager.h
AssetWrapper::AfterChildAdd
@ AfterChildAdd
Definition:
AssetWrapper.h:33
ScriptFile::forMap
bool forMap(const CREMapInformation *map) const
Definition:
ScriptFile.cpp:30
ScriptFileManager::myScripts
QHash< QString, ScriptFile * > myScripts
Definition:
ScriptFileManager.h:59
guildoracle.list
list
Definition:
guildoracle.py:87
mad_mage_user.file
file
Definition:
mad_mage_user.py:15
AssetWrapper::tipProperty
static const char * tipProperty
Definition:
AssetWrapper.h:34
CREMapInformation
Definition:
CREMapInformation.h:27
AssetWrapper::BeforeChildAdd
@ BeforeChildAdd
Definition:
AssetWrapper.h:33
disinfect.map
map
Definition:
disinfect.py:4
ScriptFile.h
ScriptFileManager::scriptsForMap
QList< ScriptFile * > scriptsForMap(CREMapInformation *map)
Definition:
ScriptFileManager.cpp:26
AssetWrapper
Definition:
AssetWrapper.h:25
python_init.path
path
Definition:
python_init.py:8
ScriptFileManager::removeMap
void removeMap(CREMapInformation *map)
Definition:
ScriptFileManager.cpp:50
ScriptFileManager::ScriptFileManager
ScriptFileManager(AssetWrapper *parent)
Definition:
ScriptFileManager.cpp:17
ScriptFileManager::scripts
QList< ScriptFile * > scripts() const
Definition:
ScriptFileManager.cpp:68
ScriptFile
Definition:
ScriptFile.h:48
ScriptFileManager::getFile
ScriptFile * getFile(const QString &path)
Definition:
ScriptFileManager.cpp:39
ScriptFile::addHook
void addHook(HookInformation *hook)
Definition:
ScriptFile.cpp:25
AssetWrapper::markModified
void markModified(ChangeType change, int extra=0)
Definition:
AssetWrapper.h:55
HookInformation
Definition:
ScriptFile.h:25
ScriptFileManager::~ScriptFileManager
virtual ~ScriptFileManager()
Definition:
ScriptFileManager.cpp:21
ScriptFileManager::addHook
void addHook(const QString &file, HookInformation *hook)
Definition:
ScriptFileManager.cpp:73
crossfire-crossfire-server
utils
cre
scripts
ScriptFileManager.cpp
Generated by
1.8.17