Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   Compound Members   Related Pages  

OBJ_STATION Class Reference

Base class for Docks and Factories, anything which can trade. More...

Inheritance diagram for OBJ_STATION:

Inheritance graph
List of all members.

Private Methods

GALOBJ Create (int x, int y, int z, int gsubtype, int ssubtype, int raceid)
BOOL IsDockingPossibleOf (GALOBJ a_ship)
int GetNumPlatforms ()
int FindFreePlatform ()
void AddShield (int gsubtype, int count)
void RemoveShield (int gsubtype, int count)
void AddShip (GALOBJ ship)
void RemoveShip (GALOBJ ship)
void SetOwner (GALOBJ owner)
void SetOwned (GALOBJ ship)
int GetNumOwnedFighters ()
int GetNumOwnedFreighters ()
void SetDisowned (GALOBJ ship)
void SetRelation (GALOBJ otherobj, int relation)
void SetGroupRelation (int raceid, int relation)
int SetRelationsToAll (int relation)
int GetRelation (GALOBJ otherobj)
BOOL IsEnemy (GALOBJ otherobj)
BOOL IsFriend (GALOBJ otherobj)
BOOL IsNeutral (GALOBJ otherobj)
int GetGroupRelation (int raceid)
void SetRelationsFromNotoriety ()
int GetSubType ()
int GetGSubType ()
array GetPos ()
table GetShips ()
array GetShields ()
table GetWares ()
table GetOwnedShips ()
GALOBJ GetOwner ()
SECOBID GetObjectID ()
GALOBJ GetEnvironment ()
int GetWareID ()
BOOL GetUnknown ()
array GetDockedShips ()
int SetShield (int newshield)
int GetShield ()
int GetMaxShield ()
int GetMaxShieldType ()
int GetWareTypeBestStore (int gtype, int gsubtype)
int GetWareTypeContainerSize (int gtype, int gsubtype)
int GetWareTypeCount (int gtype, int gsubtype)
int GetTrueWareTypeCount (int gtype, int gsubtype)
int GetWareTypeFree (int gtype, int gsubtype)
int AddWare (int gtype, int gsubtype, int count)
GALOBJ SetAttacker (GALOBJ att)
GALOBJ GetAttacker ()
void SetPos (int x, int y, int z)
void SetRot (int alpha, int beta, int gamma)
void SetSafePos ()
int GetWareTypePrice (int maintype, int subtype)
int GetWareTypeNormalPrice (int maintype, int subtype)
table GetSourceFactories ()
int TradeWare (int gtype, int gsubtype, int count)
int GetMoney ()
void AddMoney (int money)
void TradeMoney (int amount)
void SmallAttack (SECOBID attacker)
BOOL HasPolice ()
void SendSquadG (GALOBJ gattacker)
void SendSquad (SECOBID attacker)
void SendSupport ()
BOOL DropFreight ()
void SelfDestruct (int reason)
void SetTargetted (BOOL targetted)
int IsDockingAllowedForShip (GALOBJ gship)
int GetTradeTimer ()
int IsHidden (GALOBJ srcobj)
int GetClass ()
int IsClass (int cl)
int IsClassType (int cl)

Private Attributes

array st_Pos
GALOBJ st_Owner
table st_Ships
array st_Shields
table st_Wares
GALOBJ st_Environment
table st_OwnedShips
int st_NumOwnedFighters
int st_NumOwnedFreighters
SECOBID st_ObjectID
int st_WareID
int st_FactoryID
int st_Money
BOOL st_Unknown
GALOBJ st_Attacker
int st_Shield
int st_TradeTimer
SECOBID st_InnerObjectID
array st_DockedShips

Detailed Description

Base class for Docks and Factories, anything which can trade.


Member Function Documentation

void AddMoney int    money [private]
 

only for player-owned stations

void AddShield int    gsubtype,
int    count
[private]
 

add a shield of type (given in gsubtype) of an amount (given in count - can also be negative to remove shields) to the station

void AddShip GALOBJ    ship [private]
 

adds a ship to st_ships and takes care that a docking-bay is free

int AddWare int    gtype,
int    gsubtype,
int    count
[private]
 

adds amount (given in count, which also can be negative to remove a ware) of ware (given in gtype, gsubtype) to the station. (see Constant Definitions used in Xē ). returns number of wares that were moved

Reimplemented in OBJ_DOCK, and OBJ_FACTORY.

GALOBJ Create int    x,
int    y,
int    z,
int    gsubtype,
int    ssubtype,
int    raceid
[private]
 

create a station with given parameters. see *_SHIP subtype constants-definitions .

BOOL DropFreight   [private]
 

station looses (almost) all wares

int FindFreePlatform   [private]
 

Find a free landing platform and return index. if none is found, returns -1.

GALOBJ GetAttacker   [private]
 

returns st_Attacker

int GetClass   [private]
 

Functions common in every object

Reimplemented in OBJ_DOCK, OBJ_DOCK_GONER, OBJ_DOCK_TRADE, OBJ_DOCK_EQUIP, OBJ_DOCK_PIRATE, OBJ_DOCK_KHAAK, OBJ_FACTORY, OBJ_FACTORY_SHIP, OBJ_FACTORY_BIGSHIP, and OBJ_FACTORY_SMALLSHIP.

array GetDockedShips   [private]
 

returns st_DockedShips

GALOBJ GetEnvironment   [private]
 

returns st_Environment

int GetGroupRelation int    raceid [private]
 

returns the relation to a given raceid. (-1,0 or 1)

int GetGSubType   [private]
 

Differences of in-game objects

int GetMaxShield   [private]
 

returns the maximal shield strength possible for this object

int GetMaxShieldType   [private]
 

returns the biggest shield-type possible for this object. (See *_W_SHIELD subtype constants-definitions )

int GetMoney   [private]
 

returns st_Money for playerFactories and infinite money for npcs

int GetNumOwnedFighters   [private]
 

returns st_NumOwnedFighters

int GetNumOwnedFreighters   [private]
 

returns st_NumOwnedFreighters

int GetNumPlatforms   [private]
 

Return total number of landing platforms.

SECOBID GetObjectID   [private]
 

returns st_ObjectID

table GetOwnedShips   [private]
 

returns st_OwnedShips

GALOBJ GetOwner   [private]
 

returns st_Owner

array GetPos   [private]
 

returns st_Pos

int GetRelation GALOBJ    otherobj [private]
 

returns relation from this object to otherobj.

int GetShield   [private]
 

returns st_Shield or sector-shield strength

array GetShields   [private]
 

returns st_Shields

table GetShips   [private]
 

returns st_Ships

table GetSourceFactories   [private]
 

returns OBJ_GALAXY.GetProducts()

int GetSubType   [private]
 

Differences of in-game objects

int GetTradeTimer   [private]
 

returns st_TradeTimer

int GetTrueWareTypeCount int    gtype,
int    gsubtype
[private]
 

Get number of units that are truely available as ware (especially for shields and lasers).

BOOL GetUnknown   [private]
 

returns st_Unknown

int GetWareID   [private]
 

returns# st_WareID

table GetWares   [private]
 

returns st_Wares

int GetWareTypeBestStore int    gtype,
int    gsubtype
[private]
 

?what is the best amount of a given ware to store in the station?

Reimplemented in OBJ_DOCK, OBJ_FACTORY, and OBJ_FACTORY_SHIP.

int GetWareTypeContainerSize int    gtype,
int    gsubtype
[private]
 

returns how much of a given ware the station is able to store

int GetWareTypeCount int    gtype,
int    gsubtype
[private]
 

returns how much of a given ware is available on this station

int GetWareTypeFree int    gtype,
int    gsubtype
[private]
 

returns, how much of a given ware the station is yet able to store

int GetWareTypeNormalPrice int    maintype,
int    subtype
[private]
 

This function returns the price for which the station would buy or sell wares if it had a "normal number" of them in stock.

int GetWareTypePrice int    maintype,
int    subtype
[private]
 

Function to handle some special wares before using the factory and dock specific code. SG_WR_TECH246, SG_WR_TECH213, SG_WR_TECH251 and SG_WR_TECH209 have the same price everywhere.

Reimplemented in OBJ_DOCK, OBJ_FACTORY, and OBJ_FACTORY_SHIP.

BOOL HasPolice   [private]
 

returns wether the station owns at least one fighter

int IsClass int    cl [private]
 

Functions common in every object

Reimplemented in OBJ_DOCK, OBJ_DOCK_GONER, OBJ_DOCK_TRADE, OBJ_DOCK_EQUIP, OBJ_DOCK_PIRATE, OBJ_DOCK_KHAAK, OBJ_FACTORY, OBJ_FACTORY_SHIP, OBJ_FACTORY_BIGSHIP, and OBJ_FACTORY_SMALLSHIP.

int IsClassType int    cl [private]
 

The difference to IsClass() is that this fct. only checks the object an not the super-objects. Functions common in every object.

int IsDockingAllowedForShip GALOBJ    gship [private]
 

returns if a given ship is allowed to dock depending on notoriety

BOOL IsDockingPossibleOf GALOBJ    a_ship [private]
 

Can a given ship dock here?

Reimplemented in OBJ_DOCK_EQUIP, OBJ_FACTORY_BIGSHIP, and OBJ_FACTORY_SMALLSHIP.

BOOL IsEnemy GALOBJ    otherobj [private]
 

returns whether otherobj is a foe of this object.

BOOL IsFriend GALOBJ    otherobj [private]
 

returns whether otherobj is a friend of this object.

int IsHidden GALOBJ    srcobj [private]
 

Check if this object is hidden either by a nebula or using a cloaking device.

BOOL IsNeutral GALOBJ    otherobj [private]
 

returns whether otherobj is neutral to this object.

void RemoveShield int    gsubtype,
int    count
[private]
 

calls AddShield() with negative amount

void RemoveShip GALOBJ    ship [private]
 

removes ship from st_Ships

void SelfDestruct int    reason [private]
 

fct. destructs the station and landed ships. For reason see Reason for death

void SendSquad SECOBID    attacker [private]
 

Station sends all itīs landed ships to kill gattacker. This fct. uses the sector-object of the attacker.

void SendSquadG GALOBJ    gattacker [private]
 

Station sends all itīs landed ships to kill gattacker.

void SendSupport   [private]
 

Start a squad (three ships) and set it to kill all enemies (after support was requested).

GALOBJ SetAttacker GALOBJ    att [private]
 

sets st_Attacker

void SetDisowned GALOBJ    ship [private]
 

the given ship is no longer owned by this station

void SetGroupRelation int    raceid,
int    relation
[private]
 

sets relation between this station and the given raceid as specified in "relation" relation = 1 means friendly, -1 means enemy, 0 means neutral

void SetOwned GALOBJ    ship [private]
 

sets the given ship as owned by this station

void SetOwner GALOBJ    owner [private]
 

sets st_Owner

void SetPos int    x,
int    y,
int    z
[private]
 

sets the position of the station (for both cases galaxy/sector)

void SetRelation GALOBJ    otherobj,
int    relation
[private]
 

sets the relation between the race of the given GALOBJ and this station as specified in "relation". relation = 1 means friendly, -1 means enemy, 0 means neutral

void SetRelationsFromNotoriety   [private]
 

The objects relation mask is updated based on the notoriets towards all races!

int SetRelationsToAll int    relation [private]
 

sets relations between this stationīs owner and all other races as specified in "relation" relation = 1 means friendly, -1 means enemy, 0 means neutral

void SetRot int    alpha,
int    beta,
int    gamma
[private]
 

sets the rotation of the station (for both cases galaxy/sector)

void SetSafePos   [private]
 

sets the station to a safe position via SectorEngine call

int SetShield int    newshield [private]
 

sets st_Shield (also for sector case if neccessary)

void SetTargetted BOOL    targetted [private]
 

Set the station as targetted. Also marks this station as known (st_Unknown set to FALSE).

void SmallAttack SECOBID    attacker [private]
 

Launch a small attack (one defense ship) against attacker.

void TradeMoney int    amount [private]
 

same as AddMoney()

int TradeWare int    gtype,
int    gsubtype,
int    count
[private]
 

same as AddWare()


Member Data Documentation

GALOBJ st_Attacker [private]
 

Last attacker.

array st_DockedShips [private]
 

Which ship is docked at each Landing Platform.

GALOBJ st_Environment [private]
 

object containing this station (normally a sector)

int st_FactoryID [private]
 

sequential ID used to enumerate all equal factories in a sector

SECOBID st_InnerObjectID [private]
 

Sector object of station inside. If not null means the inside view is active.

int st_Money [private]
 

money, that the station possesses (mainly for player-stations)

int st_NumOwnedFighters [private]
 

nr. of fighters owned by this station

int st_NumOwnedFreighters [private]
 

nr. of freighters owned by this station

SECOBID st_ObjectID [private]
 

is set when staion is in current (active) sector

table st_OwnedShips [private]
 

ships owned by this station

GALOBJ st_Owner [private]
 

owner-object of station

array st_Pos [private]
 

Position (x,y,z).

int st_Shield [private]
 

actual shield strength (Galaxy-level)

array st_Shields [private]
 

installed Shields (OBJ_GS_WARE)

table st_Ships [private]
 

landed ships (OBJ_GS_SHIP)

int st_TradeTimer [private]
 

Time of last Trade Activity.

BOOL st_Unknown [private]
 

Factory-Type is not yet known to player.

int st_WareID [private]
 

(3 digits) id of ware that is produced by this factory (also index for factory-name)

table st_Wares [private]
 

stored wares {OBJ_GS_WARE , amount}


Generated on Mon Aug 26 18:26:35 2002 for Xē KC by doxygen1.2.17