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

OBJ_FACTORY Class Reference

A factory produces wares and needs resources. More...

Inheritance diagram for OBJ_FACTORY:

Inheritance graph
List of all members.

Private Methods

BOOL IsWareCategory (int a_waretype)
int GetTypeCode ()
GALOBJ Create (int x, int y, int z, int ssubtype, int raceid)
int GetResPercent ()
GALOBJ AddDefaultProductsAndResources ()
GALOBJ Destruct ()
void AddProduct (int gtype, int gsubtype)
void AddResource (int gtype, int gsubtype)
void AddSResource (int gtype, int gsubtype)
table GetProducts ()
table GetResources ()
table GetSResources ()
void SetFactoryID (int id)
void SetIdentifyTextID (int id)
void SetEfficiency (int eff)
int GetClass ()
int IsClass (int cl)
int GetGType ()
int GetType ()
int GetProductMainType ()
int GetProductSubType ()
int GetProductionTime ()
int GetProductionCount ()
table GetResToOrder ()
int GetFactoryID ()
string GetYourName ()
void SetYourName (string Name)
int GetEfficiency ()
int GetWareTypePrice (int maintype, int subtype)
void SetWareTypePrice (int maintype, int subtype, int price)
void AddTo (GALOBJ gsector)
void InitialFill ()
int ResourceMainTypeAvailable (int rtype)
int ResourceTypeAvailable (int rtype, int rsubtype)
int NoResources ()
int GetProductionTaskPC ()
int GetProductionTimer ()
BOOL CanBuyWareType (int gtype, int gsubtype)
BOOL CanSellWareType (int gtype, int gsubtype)
BOOL TradesWithWareType (int gtype, int gsubtype)
int GetWareTypeBestStore (int gtype, int gsubtype)
int AddWare (int gtype, int gsubtype, int count)

Private Attributes

int fa_ProductType
int fa_ProductSubType
int fa_ProdTime
int fa_ProdCount
table fa_Products
table fa_Resources
table fa_SResources
int fa_ProductionPID
int fa_IdentifyTextID
int fa_Efficiency
table fa_ResToOrder
table fa_ResourcePrices
table fa_SResourcePrices
string fa_Name
int fa_ProductionTimer
int fa_ResPercent

Detailed Description

A factory produces wares and needs resources.

A factory can potentially produce more wares (specified in fa_Products), but only one at a time (specified via fa_ProductType & fa_ProductSubType).


Member Function Documentation

GALOBJ AddDefaultProductsAndResources   [private]
 

Adds all products and resources that fit to the factory-type.

void AddProduct int    gtype,
int    gsubtype
[private]
 

Sets fa_ProductType (with gtype) and fa_ProductSubType (with gsubtype) and adds the product to fa_Products. (see Constant Definitions used in X² ).

void AddResource int    gtype,
int    gsubtype
[private]
 

adds given ware to fa_Resources

void AddSResource int    gtype,
int    gsubtype
[private]
 

adds given ware to fa_SResources

void AddTo GALOBJ    gsector [private]
 

adds factory to given sector

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

calls super.AddWare() if it can buy or sell the given ware

Reimplemented from OBJ_STATION.

BOOL CanBuyWareType int    gtype,
int    gsubtype
[private]
 

checks if given ware is needed as resource

Reimplemented from OBJ_STATION.

Reimplemented in OBJ_FACTORY_SHIP.

BOOL CanSellWareType int    gtype,
int    gsubtype
[private]
 

checks if given ware can be produced

Reimplemented from OBJ_STATION.

Reimplemented in OBJ_FACTORY_SHIP.

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

creates a factory with given parameters. See *_FACTORY subtype constants-definitions and Race IDs .

Reimplemented in OBJ_FACTORY_SHIP, OBJ_FACTORY_BIGSHIP, and OBJ_FACTORY_SMALLSHIP.

GALOBJ Destruct   [private]
 

Destruct this station, notice the owned ships of the loss of their factory and destruct all landed ships.

Reimplemented from OBJ_STATION.

int GetClass   [private]
 

Functions common in every object

Reimplemented from OBJ_STATION.

Reimplemented in OBJ_FACTORY_SHIP, OBJ_FACTORY_BIGSHIP, and OBJ_FACTORY_SMALLSHIP.

int GetEfficiency   [private]
 

returns fa_Efficiency

int GetFactoryID   [private]
 

returns st_FactoryID (defined in OBJ_Station) returns the name ID the station got from the sector engine

int GetGType   [private]
 

Differences of in-game objects

int GetProductionCount   [private]
 

return fa_ProdCount

int GetProductionTaskPC   [private]
 

returns fa_ProductionPID

int GetProductionTime   [private]
 

returns fa_ProdTime

int GetProductionTimer   [private]
 

returns fa_ProductionTimer

int GetProductMainType   [private]
 

returns fa_ProductType

table GetProducts   [private]
 

returns fa_Products

int GetProductSubType   [private]
 

returns fa_ProductSubType

table GetResources   [private]
 

returns fa_Resources

int GetResPercent   [private]
 

returns fa_ResPercent

table GetResToOrder   [private]
 

returns fa_ResToOrder

table GetSResources   [private]
 

returns fa_SResources

int GetType   [private]
 

Differences of in-game objects

int GetTypeCode   [private]
 

returns the typecode of this factory composed from SSTYPE_FACTORY and the station subType.

int GetWareTypeBestStore int    gtype,
int    gsubtype
[private]
 

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

Reimplemented from OBJ_STATION.

Reimplemented in OBJ_FACTORY_SHIP.

int GetWareTypePrice int    maintype,
int    subtype
[private]
 

The price of the given ware to sell to/buy from this factory. See Constant Definitions used in X² .

Reimplemented from OBJ_STATION.

Reimplemented in OBJ_FACTORY_SHIP.

string GetYourName   [private]
 

returns fa_Name

Reimplemented from OBJ_STATION.

void InitialFill   [private]
 

fill dock ideally with products and resources

Reimplemented in OBJ_FACTORY_SHIP.

int IsClass int    cl [private]
 

Functions common in every object

Reimplemented from OBJ_STATION.

Reimplemented in OBJ_FACTORY_SHIP, OBJ_FACTORY_BIGSHIP, and OBJ_FACTORY_SMALLSHIP.

BOOL IsWareCategory int    a_waretype [private]
 

returns wether the station - considered as a ware - is of the type given in the joined typecode a_waretype. For example a_waretype could be TYPECODE(SSTYPE_FACTORY,anySectorSubtype for factories)

Reimplemented from OBJ_STATION.

int NoResources   [private]
 

Check if the station needs a resource urgently. Returns true if it is so.

int ResourceMainTypeAvailable int    rtype [private]
 

Returns total production value of products with type rtype (is TYPECODE).

int ResourceTypeAvailable int    rtype,
int    rsubtype
[private]
 

Returns number of goods with type rtype/rsubtype.

void SetEfficiency int    eff [private]
 

sets fa_Efficiency

void SetFactoryID int    id [private]
 

set st_FactoryID

void SetIdentifyTextID int    id [private]
 

sets fa_IdentifyTextID to given id

void SetWareTypePrice int    maintype,
int    subtype,
int    price
[private]
 

Set the price of products and resources. (This makes only sense for player owned factories).

Reimplemented from OBJ_STATION.

void SetYourName string    Name [private]
 

sets fa_Name

BOOL TradesWithWareType int    gtype,
int    gsubtype
[private]
 

returns whether the factory can trade with the given ware

Reimplemented from OBJ_STATION.

Reimplemented in OBJ_FACTORY_SHIP.


Member Data Documentation

int fa_Efficiency [private]
 

yield of the factory (Mines, Solarstations ?)

int fa_IdentifyTextID [private]
 

text for speech output in identifyscreen

string fa_Name [private]
 

name of the factory

int fa_ProdCount [private]
 

the number of units of the product being produced in "fa_ProdTime"-time.

int fa_ProdTime [private]
 

time needed to produce a batch of a product (in millisec.)

int fa_ProductionPID [private]
 

Process-ID des zu dieser Fabrik gehoerenden staendig laufenden Produktions-Tasks.

int fa_ProductionTimer [private]
 

Time of last Production Activity.

table fa_Products [private]
 

Wares that can be produced here. For Shipyards the products are the factories they sell.

int fa_ProductSubType [private]
 

Subtype of actually produced ware.

int fa_ProductType [private]
 

Maintype of actually produced ware (Index in SGF_Products), -1 == no product (yard).

table fa_ResourcePrices [private]
 

Resource prices my transporters are willing to pay at other factories. Format {TYPECODE, price}.

table fa_Resources [private]
 

which wares are possible as resources (spezielle Warentypen innerhalb der SGF_Resources)

int fa_ResPercent [private]
 

how urgent are new resources needed in %

table fa_ResToOrder [private]
 

ordered amount of resource. Format : {wareTypecode,amount}

table fa_SResourcePrices [private]
 

Secondary Resource prices my transporters are willing to pay at other factories. Format {TYPECODE, price}.

table fa_SResources [private]
 

secondary resources. These are not neccessary to manifacture the product but have a positive influence of the production itself.


Generated on Mon Aug 26 18:26:25 2002 for X² KC by doxygen1.2.17