2 * This file includes the base class definition for types.
3 * An entity's conduct is very precisely defined by its assigned type.
5 * Copyright (C) 2008 Hermann Walth
7 * This file is part of OpenStranded
9 * OpenStranded is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
14 * OpenStranded is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with OpenStranded. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef STRANDED_TYPE_HH
24 #define STRANDED_TYPE_HH
28 typedef unsigned int ID
;
32 * Types are the prototypes of the single entities.
33 * There is one type class per kingdom.
34 * The single type instances include the information about the types
35 * as read from the definition files.
41 float scaleX
, scaleY
, scaleZ
;
42 uint8_t colorR
, colorG
, colorB
;
53 * @param name The name of this type (used only in editor)
55 Type (const char *name
);
70 * @param name The new name of the type
73 setName (const std::string
&name
) { this->name
= name
; }
77 * @return The current name of the type
80 getName () { return this->name
; }
90 * The model is specified by the path to the model file.
91 * @param path Path to the new model file
94 setModel (const std::string
&path
) { this->model
= path
; }
97 * Return the path to the current model.
98 * @return Path of the current model file
101 getModel () { return this->model
; }
110 * Set the path to the icon used.
111 * The icon is the little thumbnail in the editor.
112 * @param path Path to the new icon file
115 setIconPath (const std::string
&path
) { this->iconPath
= path
; }
118 * Return the current icon path.
119 * @return The path to the current icon file
122 getIconPath () { return this->iconPath
; }
131 * Set the X scaling value.
132 * The scaling values are divided into their coordinate
134 * @param scaleX The new X scaling value
137 setScaleX (const float scaleX
) { this->scaleX
= scaleX
; }
140 * Get the X scaling value.
141 * @return The current X scaling value
144 getScaleX () { return this->scaleX
; }
147 * Set the Y scaling value.
148 * @param scaleY The new Y scaling value
151 setScaleY (const float scaleY
) { this->scaleY
= scaleY
; }
154 * Get the Y scaling value.
155 * @return The current Y scaling value
158 getScaleY () { return this->scaleY
; }
161 * Set the Z scaling value.
162 * @param scaleZ The new Z scaling value
165 setScaleZ (const float scaleZ
) { this->scaleZ
= scaleZ
; }
168 * Get the Z scaling value.
169 * @return The current Z scaling value
172 getScaleZ () { return this->scaleZ
; }
182 * @param colorR The new red value ranging from 0 to 255
185 setColorR (const uint8_t colorR
) { this->colorR
= colorR
; }
189 * @return The current red value ranging from 0 to 255
192 getColorR () { return this->colorR
; }
195 * Set the green value.
196 * @param colorG The new green value ranging from 0 to 255
199 setColorG (const uint8_t colorG
) { this->colorG
= colorG
; }
202 * Get the green value
203 * @return The current green value ranging from 0 to 255
206 getColorG () { return this->colorG
; }
210 * @param colorB The new blue value ranging from 0 to 255
213 setColorB (const uint8_t colorB
) { this->colorB
= colorB
; }
217 * @return The current blue value ranging from 0 to 255
220 getColorB () { return this->colorB
; }
229 * Set the Autofading distance.
230 * This is the distance to the player when an object fades out of sight
231 * @param fadingDistance The new Autofading distance
234 setFadingDistance (const float fadingDistance
) { this->fadingDistance
= fadingDistance
; }
237 * Get the Autofading distance
238 * @return The current Autofading distance
241 getFadingDistance () { return this->fadingDistance
; }
250 * Set the value of transparency (aka alpha channel).
251 * @param alpha The new alpha value ranging from 0.0 (invisible) to 1.0 (opaque)
254 setAlpha (const float alpha
) { this->alpha
= alpha
; }
257 * Returns the transparency value.
258 * @return The current alpha value
261 getAlpha () { return this->alpha
; }
270 * Set the shine value of the model
271 * @param shine The new shine value
274 setShine (const float shine
) { this->shine
= shine
; }
277 * Get the shine value of the model
278 * @return The current shine value
281 getShine () { return this->shine
; }
284 #endif /* STRANDED_TYPE_HH */