#include <prototype.h>
Public Types | |
typedef vector< Model > | ModelsArray |
Public Member Functions | |
Prototype (const char *id) | |
virtual | ~Prototype () |
const string & | GetName () const |
const ModelsArray & | GetModels () const |
ushort_t | GetLife () const |
mapel_t | GetView () const |
const MapSize & | GetSize () const |
short | GetFood () const |
short | GetEnergy () const |
byte_t | GetMinEnergy () const |
float | GetSelectionHeight () const |
Unit::Aggressivity | GetAggressivity () const |
byte_t | GetHidingCapacity () const |
bool | CanMove () const |
bool | CanAttack () const |
bool | CanMine () const |
bool | CanRepair () const |
bool | CanBuild () const |
bool | CanHide () const |
const Terrain * | GetTerrain (MapEnums::Segment segment, byte_t terrain_id) const |
void | CheckPosition (const Map *map, const MapPosition3D &position, MapEnums::Direction direction, bool &is_moveable, bool &is_free) |
void | GetSpeeds (const Map *map, const MapPosition3D &position, MapEnums::Segment next_segment, float &speed, float &rotation) |
bool | CanHide (Prototype *prototype) const |
Protected Types | |
typedef vector< string > | HidingArray |
typedef hash_map < Prototype *, bool > | HidingCache |
Protected Member Functions | |
virtual bool | Serialize (Serializer &serializer) |
virtual bool | Deserialize (Serializer &serializer, bool first) |
bool | ReadSize (Serializer &serializer) |
bool | ReadMaterials (Serializer &serializer) |
bool | ReadResources (Serializer &serializer) |
bool | ReadModels (Serializer &serializer) |
bool | ReadGraphics (Serializer &serializer) |
bool | ReadSegments (Serializer &serializer) |
bool | ReadTerrains (Serializer &serializer, Segment &segment) |
bool | ReadHiding (Serializer &serializer) |
Protected Attributes | |
string | name |
Full prototype name. | |
Material * | materials |
Array of all materials defined in scheme. | |
ModelsArray | models |
Array of all models defined in prototype. | |
Segment | segments [MapEnums::SEG_COUNT] |
Array of all available segments. | |
ushort_t | life |
Amount of maximal life. [virtual unit]. | |
mapel_t | view |
Radius of unit view. [mapels]. | |
MapSize | size |
Unit size. [mapels]. | |
short | food |
Amount of food. Positive number means that unit will supply food, negative number means that unit will consume food. [virtual unit]. | |
short | energy |
Amount of energy. Positive number means that unit will supply energy, negative number means that unit will consume energy. [virtual unit]. | |
byte_t | min_energy |
Minimal amout of energy the unit needs for work. [%]. | |
float | selection_height |
Height of selection box (for buildings) or height of life bar (for units). [mapels]. | |
Unit::Aggressivity | aggressivity |
Default aggressivity of the unit. | |
HidingArray | hiding |
Array of prototype identifiers that can be hidden in this prototype. | |
HidingCache | hiding_cache |
Cache of pointers to prototypes. | |
byte_t | hiding_capacity |
Capacity for hided units. | |
struct { | |
bool can_move: 1 | |
Unit can move. | |
bool can_attack: 1 | |
Unit can attack (has gun). | |
bool can_mine: 1 | |
Unit can mine some sources. | |
bool can_repair: 1 | |
Unit can repair some other units. | |
bool can_build: 1 | |
Unit can build some other units. | |
bool can_hide: 1 | |
Unit can hide some other units. | |
}; | |
Private Member Functions | |
bool | CheckPosition (const Map *map, const MapPosition3D &position, bool &is_moveable, bool &is_free) |
Classes | |
struct | Material |
struct | Model |
struct | Segment |
struct | Terrain |
typedef vector<Model> Prototype::ModelsArray |
typedef vector<string> Prototype::HidingArray [protected] |
typedef hash_map<Prototype *, bool> Prototype::HidingCache [protected] |
Prototype::Prototype | ( | const char * | id | ) |
Prototype::~Prototype | ( | ) | [virtual] |
Releases materials and terrains.
const string & Prototype::GetName | ( | ) | const [inline] |
const Prototype::ModelsArray & Prototype::GetModels | ( | ) | const [inline] |
ushort_t Prototype::GetLife | ( | ) | const [inline] |
mapel_t Prototype::GetView | ( | ) | const [inline] |
const MapSize & Prototype::GetSize | ( | ) | const [inline] |
short Prototype::GetFood | ( | ) | const [inline] |
short Prototype::GetEnergy | ( | ) | const [inline] |
byte_t Prototype::GetMinEnergy | ( | ) | const [inline] |
float Prototype::GetSelectionHeight | ( | ) | const [inline] |
Unit::Aggressivity Prototype::GetAggressivity | ( | ) | const [inline] |
byte_t Prototype::GetHidingCapacity | ( | ) | const [inline] |
bool Prototype::CanMove | ( | ) | const [inline] |
bool Prototype::CanAttack | ( | ) | const [inline] |
bool Prototype::CanMine | ( | ) | const [inline] |
bool Prototype::CanRepair | ( | ) | const [inline] |
bool Prototype::CanBuild | ( | ) | const [inline] |
bool Prototype::CanHide | ( | ) | const [inline] |
const Prototype::Terrain * Prototype::GetTerrain | ( | MapEnums::Segment | segment, | |
byte_t | terrain_id | |||
) | const [inline] |
void Prototype::CheckPosition | ( | const Map * | map, | |
const MapPosition3D & | position, | |||
MapEnums::Direction | direction, | |||
bool & | is_moveable, | |||
bool & | is_free | |||
) |
void Prototype::GetSpeeds | ( | const Map * | map, | |
const MapPosition3D & | position, | |||
MapEnums::Segment | next_segment, | |||
float & | speed, | |||
float & | rotation | |||
) |
bool Prototype::CanHide | ( | Prototype * | prototype | ) | const |
bool Prototype::Serialize | ( | Serializer & | serializer | ) | [protected, virtual] |
bool Prototype::Deserialize | ( | Serializer & | serializer, | |
bool | first | |||
) | [protected, virtual] |
Recursively deserialize all children.
Reimplemented from Root.
Reimplemented in BuildingPrototype, and ForcePrototype.
bool Prototype::ReadSize | ( | Serializer & | serializer | ) | [protected] |
bool Prototype::ReadMaterials | ( | Serializer & | serializer | ) | [protected] |
bool Prototype::ReadResources | ( | Serializer & | serializer | ) | [protected] |
bool Prototype::ReadModels | ( | Serializer & | serializer | ) | [protected] |
bool Prototype::ReadGraphics | ( | Serializer & | serializer | ) | [protected] |
bool Prototype::ReadSegments | ( | Serializer & | serializer | ) | [protected] |
bool Prototype::ReadTerrains | ( | Serializer & | serializer, | |
Segment & | segment | |||
) | [protected] |
bool Prototype::ReadHiding | ( | Serializer & | serializer | ) | [protected] |
bool Prototype::CheckPosition | ( | const Map * | map, | |
const MapPosition3D & | position, | |||
bool & | is_moveable, | |||
bool & | is_free | |||
) | [private] |
string Prototype::name [protected] |
Full prototype name.
Material* Prototype::materials [protected] |
Array of all materials defined in scheme.
ModelsArray Prototype::models [protected] |
Array of all models defined in prototype.
Segment Prototype::segments[MapEnums::SEG_COUNT] [protected] |
Array of all available segments.
ushort_t Prototype::life [protected] |
Amount of maximal life. [virtual unit].
mapel_t Prototype::view [protected] |
Radius of unit view. [mapels].
MapSize Prototype::size [protected] |
Unit size. [mapels].
short Prototype::food [protected] |
Amount of food. Positive number means that unit will supply food, negative number means that unit will consume food. [virtual unit].
short Prototype::energy [protected] |
Amount of energy. Positive number means that unit will supply energy, negative number means that unit will consume energy. [virtual unit].
byte_t Prototype::min_energy [protected] |
Minimal amout of energy the unit needs for work. [%].
float Prototype::selection_height [protected] |
Height of selection box (for buildings) or height of life bar (for units). [mapels].
Unit::Aggressivity Prototype::aggressivity [protected] |
Default aggressivity of the unit.
HidingArray Prototype::hiding [protected] |
Array of prototype identifiers that can be hidden in this prototype.
HidingCache Prototype::hiding_cache [mutable, protected] |
Cache of pointers to prototypes.
byte_t Prototype::hiding_capacity [protected] |
Capacity for hided units.
bool Prototype::can_move |
Unit can move.
Unit can attack (has gun).
bool Prototype::can_mine |
Unit can mine some sources.
Unit can repair some other units.
bool Prototype::can_build |
Unit can build some other units.
bool Prototype::can_hide |
Unit can hide some other units.
struct { ... } [protected] |