Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <docking.h>
Public Member Functions | |
QVector | Movement (Unit *utdw) |
DockingOps (Unit *unitToDockWith, Order *oldstate, bool physicallyDock, bool keeptrying) | |
virtual void | SetParent (Unit *par) |
Sets the parent of this Unit. Any virtual functions must call this one. More... | |
void | Execute () |
The function that gets called and executes all queued suborders. More... | |
bool | RequestClearence (Unit *) |
bool | DockToTarget (Unit *) |
bool | PerformDockingOperations (Unit *) |
bool | Undock (Unit *) |
virtual void | Destroy () |
The virutal function that unrefs all memory then calls Destruct () which takes care of unreffing this or calling delete on this. More... | |
void | RestoreOldAI () |
![]() | |
void | SetAfterburn (bool tf) |
The last_velocity keeps track of the previous velocity so the script may determine if it has crossed over 0 this frame or not. More... | |
MoveTo (const QVector &target, bool aft, unsigned char switchbacks, bool terminating=true) | |
takes in the destination target, whether afterburners should be applied, and the ammount of accuracy (how many times it shoudl miss destination and come back) should be used More... | |
void | SetDest (const QVector &) |
virtual | ~MoveTo () |
virtual string | getOrderDescription () |
![]() | |
virtual void | ChooseTarget () |
this function calls the destructor (needs to be overridden for python; More... | |
virtual bool | PursueTarget (Unit *, bool isleader) |
void | ClearMessages () |
clears the messasges of this order More... | |
Order () | |
The default constructor setting everything to NULL and no dependency on order. More... | |
Order (int type, int subtype) | |
The constructor that specifies what order dependencies this order has. More... | |
Order * | queryType (unsigned int type) |
returns a pointer to the first order that may be bitwised ored with that type More... | |
Order * | queryAny (unsigned int type) |
returns a pointer to the first order that may be bitwise ored with any type More... | |
void | eraseType (unsigned int type) |
Erases all orders that bitwise OR with that type. More... | |
bool | AttachOrder (Unit *targets) |
Attaches a group of targets to this order (used for strategery-type games) More... | |
bool | AttachOrder (QVector target) |
Attaches a navigation point to this order. More... | |
bool | AttachSelfOrder (Unit *targets) |
Attaches a group (form up) to this order. More... | |
Order * | EnqueueOrder (Order *ord) |
Enqueues another order that will be executed (in parallel perhaps) when next void Execute() is called. More... | |
Order * | ReplaceOrder (Order *ord) |
Replaces the first order of that type in the order queue. More... | |
bool | Done () |
int | getType () |
int | getSubType () |
Unit * | GetParent () const |
virtual void | Communicate (const class CommunicationMessage &c) |
Sends a communication message from the Unit (encapulated in c) to this unit. More... | |
virtual void | ProcessCommMessage (class CommunicationMessage &c) |
processes a single message...generally called by the Messages() func More... | |
virtual void | ProcessCommunicationMessages (float CommRepsonseTime, bool RemoveMessageProcessed) |
responds (or does not) to certain messages in the message queue More... | |
Order * | findOrder (Order *ord) |
return pointer to order or NULL if not found More... | |
void | eraseOrder (Order *ord) |
erase that order from the list More... | |
Order * | EnqueueOrderFirst (Order *ord) |
enqueue order as first order More... | |
virtual olist_t * | getOrderList () |
returns the orderlist (NULL for orders that haven't got any) More... | |
virtual void | AdjustRelationTo (Unit *un, float factor) |
Order * | findOrderList () |
searches the suborders recursively for the first order that has an orderlist More... | |
std::string | createFullOrderDescription (int level=0) |
void | setActionString (std::string astring) |
std::string | getActionString () |
virtual float | getMood () |
Additional Inherited Members | |
![]() | |
enum | ORDERTYPES { MOVEMENT =1, FACING =2, WEAPON =4, CLOAKING =8, ALLTYPES =(1|2|4|8) } |
The varieties of order types MOVEMENT,FACING, and WEAPON orders may not be mutually executed (lest one engine goes left, the other right) More... | |
enum | SUBORDERTYPES { SLOCATION =1, STARGET =2, SSELF =4 } |
![]() | |
virtual | ~Order () |
virtual void | Destructor () |
changes the local relation of this unit to another...may inform superiors about "good" or bad! behavior depending on the AI More... | |
![]() | |
Unit * | parent |
The unit this order is attached to. More... | |
unsigned int | type |
The bit code (from ORDERTYPES) that this order is (for parallel execution) More... | |
unsigned int | subtype |
bool | done |
Whether or not this order is done. More... | |
UnitContainer | group |
If this order applies to a group of units (as in form up with this group) More... | |
QVector | targetlocation |
If this order applies to a physical location in world space. More... | |
std::vector< Order * > | suborders |
The queue of suborders that will be executed in parallel according to bit code. More... | |
std::list< class CommunicationMessage * > | messagequeue |
a bunch of communications that have not been answered CommunicationMessages are actually containing reference to a nice Finite State Machine that can allow a player to have a reasonable conversation with an AI More... | |
std::string | actionstring |
Orders::DockingOps::DockingOps | ( | Unit * | unitToDockWith, |
Order * | oldstate, | ||
bool | physicallyDock, | ||
bool | keeptrying | ||
) |
Definition at line 23 of file docking.cpp.
References VegaConfig::getVariable(), XMLSupport::parse_float(), and vs_config.
|
virtual |
The virutal function that unrefs all memory then calls Destruct () which takes care of unreffing this or calling delete on this.
Reimplemented from Order.
Definition at line 86 of file docking.cpp.
References Order::Destroy(), Order::parent, Unit::SetOwner(), and UnitContainer::SetUnit().
Referenced by Execute().
Definition at line 150 of file docking.cpp.
References Unit::Dock(), DockedScript(), Unit::DockingPortLocations(), VegaConfig::getVariable(), Unit::isUnit(), Movement(), Order::parent, XMLSupport::parse_float(), PLANETPTR, Unit::Position(), QVector, Unit::RefillWarpEnergy(), Unit::rSize(), UnitContainer::SetUnit(), SIMULATION_ATOM, vs_config, and Unit::WarpCapData().
Referenced by Execute().
|
virtual |
The function that gets called and executes all queued suborders.
Reimplemented from Orders::MoveTo.
Definition at line 46 of file docking.cpp.
References Destroy(), DockToTarget(), Order::done, UnitContainer::GetUnit(), Order::parent, PerformDockingOperations(), RequestClearence(), RestoreOldAI(), Unit::SetAngularVelocity(), Undock(), and Vector.
Definition at line 135 of file docking.cpp.
References DistanceWarrantsTravelTo(), Unit::DockingPortLocations(), Order::EnqueueOrder(), Orders::MoveTo::Execute(), Unit::GetTransformation(), Magnitude(), Order::parent, Unit::Position(), QVector, Orders::MoveTo::SetAfterburn(), Orders::MoveTo::SetDest(), Transform(), and WarpToP().
Referenced by DockToTarget(), and PerformDockingOperations().
Definition at line 194 of file docking.cpp.
References Order::EnqueueOrder(), Orders::MoveTo::Execute(), VegaConfig::getVariable(), Unit::isUnit(), Movement(), Order::parent, XMLSupport::parse_float(), PLANETPTR, Unit::Position(), QVector, Orders::MoveTo::SetDest(), SIMULATION_ATOM, Unit::UnDock(), up, and vs_config.
Referenced by Execute().
Definition at line 126 of file docking.cpp.
References Order::parent, Unit::RequestClearance(), and Orders::SelectDockPort().
Referenced by Execute().
void Orders::DockingOps::RestoreOldAI | ( | ) |
Definition at line 99 of file docking.cpp.
References Unit::aistate, Order::parent, and Unit::SetOwner().
Referenced by Execute().
|
virtual |
Sets the parent of this Unit. Any virtual functions must call this one.
Reimplemented from Order.
Definition at line 38 of file docking.cpp.
References UnitContainer::GetUnit(), Unit::owner, Order::parent, Unit::SetOwner(), and Order::SetParent().
Definition at line 221 of file docking.cpp.
References Order::done, Orders::MoveTo::Execute(), Order::parent, Unit::Position(), QVector, Unit::rSize(), Orders::MoveTo::SetDest(), and SIMULATION_ATOM.
Referenced by Execute().