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
RegionWrapper.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 "
RegionWrapper.h
"
14
#include "../ResourcesManager.h"
15
#include "../CREMapInformationManager.h"
16
#include "../scripts/ScriptFile.h"
17
#include "../archetypes/ArchetypeWrapper.h"
18
19
RegionWrapper::RegionWrapper
(
AssetWrapper
*parent,
region
*reg,
ResourcesManager
*resources) :
AssetTWrapper
(parent,
"Region"
, reg),
20
myResourcesManager(resources) {
21
connect
(resources->
getMapInformationManager
(), SIGNAL(
mapAdded
(
CREMapInformation
*)),
this
, SLOT(
mapAdded
(
CREMapInformation
*)));
22
}
23
24
int
RegionWrapper::childrenCount
()
const
{
25
return
myMaps
.size();
26
}
27
28
AssetWrapper
*
RegionWrapper::child
(
int
index
) {
29
return
myMaps
[
index
];
30
}
31
32
int
RegionWrapper::childIndex
(
AssetWrapper
*child) {
33
for
(
int
idx = 0; idx <
myMaps
.size(); idx++) {
34
if
(
myMaps
[idx] ==
child
) {
35
return
idx;
36
}
37
}
38
return
-1;
39
}
40
41
AssetWrapper::PossibleUse
RegionWrapper::uses
(
const
AssetWrapper
*asset, std::string &)
const
{
42
return
(
dynamic_cast<
const
QuestWrapper
*
>
(asset)
43
||
dynamic_cast<
const
FaceWrapper
*
>
(asset)
44
||
dynamic_cast<
const
AnimationWrapper
*
>
(asset)
45
||
dynamic_cast<
const
ScriptFile
*
>
(asset)
46
||
dynamic_cast<
const
ArchetypeWrapper
*
>
(asset)
47
) ?
ChildrenMayUse
:
DoesntUse
;
48
}
49
50
void
RegionWrapper::mapAdded
(
CREMapInformation
*
map
) {
51
if
(
map
->region() ==
myWrappedItem
->
name
) {
52
markModified
(
BeforeLayoutChange
);
53
myMaps
=
myResourcesManager
->
getMapInformationManager
()->
getMapsForRegion
(
myWrappedItem
->
name
);
54
markModified
(
AfterLayoutChange
);
55
}
56
}
AssetTWrapper< region >::myWrappedItem
region * myWrappedItem
Definition:
AssetWrapper.h:108
AssetWrapper::AfterLayoutChange
@ AfterLayoutChange
Definition:
AssetWrapper.h:33
RegionWrapper::RegionWrapper
RegionWrapper(AssetWrapper *parent, region *reg, ResourcesManager *resources)
Definition:
RegionWrapper.cpp:19
ResourcesManager
Definition:
ResourcesManager.h:80
AnimationWrapper
Definition:
AnimationWrapper.h:24
QuestWrapper
Definition:
QuestWrapper.h:66
AssetWrapper::PossibleUse
PossibleUse
Definition:
AssetWrapper.h:32
region::name
char * name
Definition:
map.h:273
RegionWrapper::child
virtual AssetWrapper * child(int index) override
Definition:
RegionWrapper.cpp:28
AssetWrapper::ChildrenMayUse
@ ChildrenMayUse
Definition:
AssetWrapper.h:32
RegionWrapper::mapAdded
void mapAdded(CREMapInformation *map)
Definition:
RegionWrapper.cpp:50
ResourcesManager::getMapInformationManager
CREMapInformationManager * getMapInformationManager()
Definition:
ResourcesManager.h:91
CREMapInformation
Definition:
CREMapInformation.h:27
RegionWrapper::childIndex
virtual int childIndex(AssetWrapper *child) override
Definition:
RegionWrapper.cpp:32
FaceWrapper
Definition:
FaceWrapper.h:24
disinfect.map
map
Definition:
disinfect.py:4
AssetWrapper
Definition:
AssetWrapper.h:25
RegionWrapper::myMaps
QList< CREMapInformation * > myMaps
Definition:
RegionWrapper.h:53
RegionWrapper.h
CREMapInformationManager::getMapsForRegion
QList< CREMapInformation * > getMapsForRegion(const QString ®ion)
Definition:
CREMapInformationManager.cpp:793
ScriptFile
Definition:
ScriptFile.h:48
region
Definition:
map.h:272
ArchetypeWrapper
Definition:
ArchetypeWrapper.h:25
AssetWrapper::BeforeLayoutChange
@ BeforeLayoutChange
Definition:
AssetWrapper.h:33
npc_dialog.index
int index
Definition:
npc_dialog.py:109
RegionWrapper::childrenCount
virtual int childrenCount() const override
Definition:
RegionWrapper.cpp:24
RegionWrapper::myResourcesManager
ResourcesManager * myResourcesManager
Definition:
RegionWrapper.h:52
AssetWrapper::markModified
void markModified(ChangeType change, int extra=0)
Definition:
AssetWrapper.h:55
RegionWrapper::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition:
RegionWrapper.cpp:41
AssetWrapper::DoesntUse
@ DoesntUse
Definition:
AssetWrapper.h:32
connect
Definition:
connect.py:1
AssetTWrapper
Definition:
AssetWrapper.h:98
crossfire-crossfire-server
utils
cre
regions
RegionWrapper.cpp
Generated by
1.8.17