#include <unit.h>
typedef list<ForceUnit *> Unit::HidingList [private] |
enum Unit::Type |
enum Unit::State |
enum Unit::Flag |
enum Unit::Action |
enum Unit::Input |
enum Unit::Aggressivity |
Aggresivity of the unit when detects enemy.
enum Unit::ModelType |
Unit::Unit | ( | const char * | id | ) |
Direction of unit is set to random number.
Unit::~Unit | ( | ) | [virtual] |
Releases scene objects, ghost owner, path and all waiting events.
void Unit::Say | ( | bool | possitive, | |
const char * | message, | |||
... | ||||
) | const |
ushort_t Unit::GetRemoteID | ( | ) | const [inline] |
Unit::Type Unit::GetType | ( | ) | const [inline] |
bool Unit::TestType | ( | Type | type | ) | const [inline] |
Unit::State Unit::GetState | ( | ) | const [inline] |
bool Unit::TestState | ( | State | state | ) | const [inline] |
void Unit::SetLife | ( | float | life | ) |
float Unit::GetLife | ( | ) | const [inline] |
float Unit::GetLifePercent | ( | ) | const [inline] |
Player * Unit::GetPlayer | ( | ) | const [inline] |
Prototype * Unit::GetPrototype | ( | ) | const [inline] |
bool Unit::SetPrototype | ( | Prototype * | prototype | ) |
const MapPosition3D & Unit::GetMapPosition | ( | ) | const [inline] |
void Unit::SetMapPosition | ( | const MapPosition3D & | position, | |
bool | change_real = true | |||
) | [inline] |
Sets new map position. Real position is changed only if second paramater is set to true
. Meeting point is reset to the same value as map position.
const vector3 & Unit::GetRealPosition | ( | ) | const [inline] |
void Unit::SetRealPosition | ( | float | x, | |
float | y | |||
) |
MapEnums::Direction Unit::GetDirection | ( | ) | const [inline] |
void Unit::SetDirection | ( | MapEnums::Direction | direction | ) | [inline] |
void Unit::GetCenterPosition | ( | vector2 & | position | ) | const |
bool Unit::GetMeetingPoint | ( | MapPosition3D & | meeting_point | ) | const [inline] |
SceneObject * Unit::GetSceneObject | ( | ) | const [inline] |
Unit::Aggressivity Unit::SetAggressivity | ( | Aggressivity | aggressivity | ) |
The method sets new unit's aggressivity. If given aggressivity is not compatible, the highest possible is set.
Unit::Aggressivity Unit::GetAggressivity | ( | ) | const [inline] |
bool Unit::TestAggressivity | ( | Unit::Aggressivity | aggressivity | ) | const [inline] |
float Unit::GetHidingPercent | ( | ) | const |
byte_t Unit::GetHidingCount | ( | ) | const [inline] |
bool Unit::IsMy | ( | ) | const |
bool Unit::IsIdle | ( | ) | const [inline] |
bool Unit::IsMoving | ( | ) | const [inline] |
bool Unit::IsFull | ( | ) | const |
void Unit::Update | ( | bool & | create_ghost, | |
bool & | delete_unit | |||
) |
Unit::Action Unit::GetAction | ( | ) | const [inline] |
bool Unit::TestAction | ( | Unit::Action | action | ) | const [inline] |
bool Unit::CanEject | ( | ) | const [inline] |
bool Unit::CanHide | ( | const ForceUnit * | unit | ) | const |
void Unit::AddToHidingList | ( | ForceUnit * | unit | ) |
Simply adds unit into the list. No checks and actions are done here. Use CanHide method to test if unit can be hide to this one.
void Unit::RemoveFromHidingList | ( | ForceUnit * | unit | ) |
Simply removes unit from list. No other actions are done here.
void Unit::ShowMeetingPoint | ( | bool | show | ) | const |
bool Unit::StringToModelType | ( | const string & | name, | |
ModelType & | type | |||
) | [static] |
bool Unit::ModelTypeToString | ( | ModelType | type, | |
string & | name | |||
) | [static] |
void Unit::SetState | ( | State | state | ) | [protected] |
bool Unit::PreProcessEvent | ( | StateEvent * | pevent | ) | [protected] |
void Unit::PostProcessEvent | ( | ) | [protected] |
void Unit::SetGhostOwner | ( | Unit * | owner | ) | [inline, protected] |
bool Unit::StartMoving | ( | Unit * | unit | ) | [protected] |
bool Unit::StartMoving | ( | const MapPosition3D & | dest_position | ) | [protected] |
bool Unit::StartEjecting | ( | ) | [protected] |
void Unit::StopAction | ( | ) | [protected, virtual] |
Reimplemented in ForceUnit.
void Unit::SetMeetingPoint | ( | const MapPosition3D & | meeting_point | ) | [protected] |
void Unit::OnMessage | ( | ActionEvent * | pevent | ) | [protected, virtual] |
void Unit::OnMessage | ( | StateEvent * | pevent | ) | [protected, virtual] |
Reimplemented from MessageReceiver< StateEvent >.
Reimplemented in ForceUnit.
void Unit::OnMessage | ( | InputEvent * | pevent | ) | [protected, virtual] |
Reimplemented from MessageReceiver< InputEvent >.
void Unit::OnMessage | ( | PathResponse * | response | ) | [protected, virtual] |
Reimplemented from MessageReceiver< PathResponse >.
bool Unit::IsAroundUnit | ( | const Unit * | unit | ) | const [protected] |
bool Unit::FindFreePositionAroundUnit | ( | const Unit * | unit, | |
MapPosition3D & | free_position, | |||
MapEnums::Direction & | free_direction | |||
) | const [protected] |
void Unit::GetFirstEjectingPosition | ( | MapPosition3D & | position, | |
const MapSize & | unit_size | |||
) | const [protected] |
void Unit::GetNextEjectingPosition | ( | MapPosition3D & | position, | |
const MapSize & | unit_size | |||
) | const [protected] |
bool Unit::SetModel | ( | const string & | model_id, | |
byte_t | num_id | |||
) | [protected, virtual] |
Reimplemented in BuildingUnit, and ForceUnit.
bool Unit::ActivateModel | ( | ModelType | model | ) | [protected, virtual] |
Reimplemented in BuildingUnit, and ForceUnit.
void Unit::RenderPred | ( | ) | [protected, virtual] |
void Unit::RenderPost | ( | ) | [protected, virtual] |
SelectionRenderer * Unit::GetSelectionRenderer | ( | ) | [protected, virtual] |
Reimplemented in BuildingUnit.
void Unit::OnRenderBegin | ( | void * | data | ) | [static, protected] |
void Unit::OnRenderEnd | ( | void * | data | ) | [static, protected] |
bool Unit::Serialize | ( | Serializer & | serializer | ) | [protected, virtual] |
bool Unit::Deserialize | ( | Serializer & | serializer, | |
bool | first | |||
) | [protected, virtual] |
Recursively deserialize all children.
Reimplemented from Root.
bool Unit::ReadPosition | ( | Serializer & | serializer | ) | [protected] |
bool Unit::StartMoving | ( | const MapArea & | dest_area, | |
MapEnums::Segment | dest_segment, | |||
Unit * | unit | |||
) | [private] |
friend class Player [friend] |
ushort_t Unit::remote_id [protected] |
Type Unit::type [protected] |
State Unit::state [protected] |
State of the unit. Can be set only by unit itself.
Player* Unit::player [protected] |
string Unit::prototype_id [protected] |
Prototype* Unit::prototype [protected] |
SceneObject* Unit::scene_object [protected] |
SceneObject* Unit::meeting_object [protected] |
float Unit::life [protected] |
float Unit::life_percent [protected] |
MapPosition3D Unit::map_position [protected] |
vector3 Unit::real_position [protected] |
MapEnums::Direction Unit::direction [protected] |
Aggressivity Unit::aggressivity [protected] |
HidingList Unit::hiding_units [protected] |
byte_t Unit::hiding_count [protected] |
Total number of fields engaged by hiding units.
byte_t Unit::hiding_count_my [protected] |
Number of my units that are hiding here.
MapPosition3D Unit::meeting_point [protected] |
Unit* Unit::ghost_owner [protected] |
List<BaseMessage> Unit::waiting_queue [protected] |
uint_t Unit::sequence [protected] |
uint_t Unit::path_request_id [protected] |
Path* Unit::path [protected] |