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
RandomMaps.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 RANDOM_MAPS_H
14
#define RANDOM_MAPS_H
15
16
#include "
assets/AssetWrapper.h
"
17
#include "
CREMapInformationManager.h
"
18
#include "
RandomMap.h
"
19
20
class
RandomMaps
:
public
AssetWrapper
{
21
Q_OBJECT
22
public
:
23
RandomMaps
(
AssetWrapper
*parent,
CREMapInformationManager
*
maps
) :
AssetWrapper
(parent),
myMaps
(
maps
),
myNeedRefresh
(false) {
24
connect
(
maps
, SIGNAL(
mapAdded
(
CREMapInformation
*)),
this
, SLOT(
mapAdded
(
CREMapInformation
*)));
25
setProperty(
tipProperty
, tr(
"Display all random maps."
));
26
}
27
28
virtual
QString
displayName
()
const override
{
return
tr(
"Random maps"
); }
29
30
virtual
int
childrenCount
()
const override
{
refresh
();
return
myCache
.size(); }
31
virtual
AssetWrapper
*
child
(
int
child
)
override
{
refresh
();
return
myCache
[
child
]; }
32
virtual
int
childIndex
(
AssetWrapper
*
child
)
override
{
refresh
();
return
myCache
.indexOf(
static_cast<
RandomMap
*
>
(
child
)); }
33
34
protected
slots:
35
void
mapAdded
(
CREMapInformation
*
map
) {
36
if
(!
map
->randomMaps().empty()) {
37
myNeedRefresh
=
true
;
38
}
39
}
40
41
private
:
42
CREMapInformationManager
*
myMaps
;
43
mutable
bool
myNeedRefresh
;
44
mutable
QList<RandomMap *>
myCache
;
45
46
void
refresh
()
const
{
47
if
(
myNeedRefresh
) {
48
myNeedRefresh
=
false
;
49
myCache
=
myMaps
->
randomMaps
();
50
}
51
}
52
};
53
54
#endif
/* RANDOM_MAPS_H */
RandomMap
Definition:
RandomMap.h:24
CREMapInformationManager::randomMaps
QList< RandomMap * > randomMaps()
Definition:
CREMapInformationManager.cpp:813
maps
static std::unordered_map< std::string, mapzone * > maps
Definition:
citylife.cpp:92
AssetWrapper.h
RandomMaps::displayName
virtual QString displayName() const override
Definition:
RandomMaps.h:28
RandomMap.h
RandomMaps
Definition:
RandomMaps.h:20
AssetWrapper::tipProperty
static const char * tipProperty
Definition:
AssetWrapper.h:34
CREMapInformation
Definition:
CREMapInformation.h:27
disinfect.map
map
Definition:
disinfect.py:4
AssetWrapper
Definition:
AssetWrapper.h:25
RandomMaps::childIndex
virtual int childIndex(AssetWrapper *child) override
Definition:
RandomMaps.h:32
RandomMaps::myCache
QList< RandomMap * > myCache
Definition:
RandomMaps.h:44
RandomMaps::child
virtual AssetWrapper * child(int child) override
Definition:
RandomMaps.h:31
CREMapInformationManager.h
RandomMaps::childrenCount
virtual int childrenCount() const override
Definition:
RandomMaps.h:30
RandomMaps::myNeedRefresh
bool myNeedRefresh
Definition:
RandomMaps.h:43
RandomMaps::refresh
void refresh() const
Definition:
RandomMaps.h:46
RandomMaps::myMaps
CREMapInformationManager * myMaps
Definition:
RandomMaps.h:42
RandomMaps::mapAdded
void mapAdded(CREMapInformation *map)
Definition:
RandomMaps.h:35
RandomMaps::RandomMaps
RandomMaps(AssetWrapper *parent, CREMapInformationManager *maps)
Definition:
RandomMaps.h:23
connect
Definition:
connect.py:1
CREMapInformationManager
Definition:
CREMapInformationManager.h:27
crossfire-crossfire-server
utils
cre
random_maps
RandomMaps.h
Generated by
1.8.17