Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

a_unit Struct Reference

Unit. More...

#include <unit.h>

Collaboration diagram for a_unit:

Collaboration graph
[legend]
List of all members.

Public Attributes

short type
int id
char * name
int number
a_unit_viewuview
a_image_familyimf
char * image_name
short x
short y
short z
a_sideside
a_sideorigside
short hp
short hp2
short cp
short cxp
short morale
a_unittransport
SideMask tracking
long * supply
short s_flow
short s_conn
short * tooling
short * opinions
a_actorstateact
a_planplan
a_unit_extrasextras
char * aihook
a_unitoccupant
a_unitnexthere
a_unitprev
a_unitnext
a_unitunext
short prevx
short prevy
Objtransport_id
short flags
short size
short reach
short usedcells
short maxcells
short curadvance
long population
short * production
short cp_stash
short researchdone
short busy
int creation_id

Detailed Description

Unit.

The Unit structure should be small, because there may be many of them. Unit semantics go in this structure, while unit brains go into the act/plan. Test: a unit that is like a rock and can't do anything at all just needs basic slots, plan needn't be allocated. Another test: unit should still function correctly after its current plan has been destroyed and replae`d with another.

Note:
unit->side and unit->origside must always point to valid side objects; dereferences are not checked!


Member Data Documentation

struct a_actorstate* a_unit::act
 

the unit's current actor state

char* a_unit::aihook
 

used by AI to keep info about this unit

short a_unit::busy
 

Broadcasted action that has not yet executed.

Note:
this is NOT the same as has_pending_action(unit), which tells us that an action has been broadcasted and then confirmed by the host. The busy flag is set locally client-side long before that, when the action is first broadcasted. Its purpose is to filter out double-clicks which may cause commands to be issued to a dead unit.

short a_unit::cp
 

state of construction

short a_unit::cp_stash
 

CP's recovered from incomplete build tasks.

int a_unit::creation_id
 

Id of unit's unbuilt creation.

short a_unit::curadvance
 

Advance currently being researched.

short a_unit::cxp
 

combat experience

struct a_unit_extras* a_unit::extras
 

pointer to optional stuff

short a_unit::flags
 

assorted flags

short a_unit::hp
 

how much more damage each part can take

short a_unit::hp2
 

buffer for next value of hp

int a_unit::id
 

truly unique id number

char* a_unit::image_name
 

the name of the image, if given

struct a_image_family* a_unit::imf
 

the image family

short a_unit::maxcells
 

Max number of cells that unit can use

short a_unit::morale
 

morale

char* a_unit::name
 

the name, if given

struct a_unit* a_unit::next
 

next unit in list of side's units

struct a_unit* a_unit::nexthere
 

pointer to fellow occupant

int a_unit::number
 

semi-unique number

struct a_unit* a_unit::occupant
 

pointer to first unit being carried

short* a_unit::opinions
 

opinion of each side, both own and others

struct a_side* a_unit::origside
 

the first side this unit was on

struct a_plan* a_unit::plan
 

the unit's current plan

long a_unit::population
 

Size of units population

struct a_unit* a_unit::prev
 

previous unit in list of side's units

short a_unit::prevx
 

x co-odinate of where were we last

short a_unit::prevy
 

y co-ordinate of where were we last

short* a_unit::production
 

Cache of units last production.

short a_unit::reach
 

Size of the unit's zone of influence

short a_unit::researchdone
 

We are done with research for this turn.

short a_unit::s_conn
 

how well connected we are to supply zones

short a_unit::s_flow
 

how much supply we received this turn

struct a_side* a_unit::side
 

whose side this unit is on

short a_unit::size
 

Abstract size of the unit

long* a_unit::supply
 

how much supply we're carrying

short* a_unit::tooling
 

level of preparation for construction

SideMask a_unit::tracking
 

which sides always see us (bit vector)

struct a_unit* a_unit::transport
 

pointer to transporting unit if any

Obj* a_unit::transport_id
 

read-in id of transport

short a_unit::type
 

type

struct a_unit* a_unit::unext
 

next unit in list of all units

short a_unit::usedcells
 

Number of cells actually used by unit

struct a_unit_view* a_unit::uview
 

master view of unit

short a_unit::x
 

x position of unit in world

short a_unit::y
 

y position of unit in world

short a_unit::z
 

z position of unit in world


The documentation for this struct was generated from the following file:
Generated on Sat Sep 17 10:30:33 2005 for XconqKernel by doxygen 1.3.6