april
1.0.0
...
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
factory.h
Go to the documentation of this file.
1
/* ========================================================================= */
2
/* ------------------------------------------------------------------------- */
/*
12
13
14
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
Please read COPYING and README files in root folder
16
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17
*/
18
/* ------------------------------------------------------------------------- */
19
/* ========================================================================= */
20
#ifndef __FACTORY_INC__
21
#define __FACTORY_INC__
22
//
23
//
24
//
25
//
26
/* INCLUDES ------------------------------------------------------------ */
27
28
#include <
april/april.h
>
29
#include <
april/logic/uniqueid.h
>
30
31
/* INCLUDES ============================================================ */
32
//
33
//
34
//
35
//
36
/* DEFINITIONS --------------------------------------------------------- */
37
38
namespace
april {
39
40
class
World;
41
class
ActorComp;
42
44
enum
FactoryType {
45
FTyGeneric = 0,
46
FTyActor,
47
FTyGenericActor,
48
FTyActuator,
49
FTyBrain,
50
FTyEvent,
51
FTyReflex,
52
FTySensor,
53
FTyWorld,
54
55
FTyMax
56
};
57
58
59
/* DEFINITIONS ========================================================= */
60
//
61
//
62
//
63
//
64
/* CLASS --------------------------------------------------------------- */
65
69
class
70
APRILSHARED_EXPORT
71
Factory
:
public
libbbb::RefCnt,
public
MemTrack {
72
BBM_TRACK(
Factory
);
73
74
//
75
//
76
//
77
//
78
/* DEFINITIONS ----------------------------------------------------- */
79
80
friend
class
ActorComp
;
81
82
/* DEFINITIONS ===================================================== */
83
//
84
//
85
//
86
//
87
/* DATA ------------------------------------------------------------ */
88
89
private
:
90
92
World
* w_;
93
95
QString s_name_for_id_;
96
97
/* DATA ============================================================ */
98
//
99
//
100
//
101
//
102
/* FUNCTIONS ------------------------------------------------------- */
103
104
public
:
105
109
Factory
(
World
* w );
110
111
protected
:
112
116
virtual
~
Factory
(
void
);
117
118
public
:
119
121
virtual
FactoryType factoryType (
void
)
122
{
return
FTyGeneric; }
123
125
virtual
QString factoryName (
void
)
126
{
return
"Generic.Factory.Default"
; }
127
129
inline
World
* world (
void
)
const
130
{
return
w_; }
131
133
virtual
const
QString & name ( ID
id
)
const
134
{ Q_UNUSED(
id
);
return
s_name_for_id_; }
135
137
virtual
QList<qreal> averageDNA ( ID
id
)
const
138
{ Q_UNUSED(
id
);
return
QList<qreal>(); }
139
141
virtual
bool
save ( QSettings & s )
const
;
142
144
virtual
bool
load ( QSettings & s );
145
146
protected
:
147
149
void
setName (
const
QString & s )
150
{ s_name_for_id_ = s; }
151
153
162
bool
setEnergy (
163
ActorComp
* comp,
164
quint64 energy,
165
quint64 cost
166
);
167
168
169
/* FUNCTIONS ======================================================= */
170
//
171
//
172
//
173
//
174
175
};
/* class Factory */
176
177
/* CLASS =============================================================== */
178
//
179
//
180
//
181
//
182
183
}
// namespace april
184
185
#endif // __FACTORY_INC__
186
/* ------------------------------------------------------------------------- */
187
/* ========================================================================= */
april
logic
factory.h
Generated on Sat Apr 20 2013 16:35:29 for april by
1.8.1.2