Planeshift
Classes | Public Types | Public Member Functions | Static Public Attributes

Tribe Class Reference

Class used to define a Tribal Object. More...

#include <tribe.h>

List of all members.

Classes

struct  Asset
struct  CyclicRecipe
struct  MemberID
struct  Memory
struct  Resource

Public Types

enum  AssetStatus { ASSET_STATUS_NOT_APPLICABLE, ASSET_STATUS_NOT_USED, ASSET_STATUS_INCONSTRUCTION, ASSET_STATUS_CONSTRUCTED }
enum  AssetType { ASSET_TYPE_ITEM, ASSET_TYPE_BUILDING, ASSET_TYPE_BUILDINGSPOT }
typedef csHash< csString,
csString > 
BufferHash

Public Member Functions

void AddAsset (Tribe::AssetType type, csString name, gemNPCItem *item, int quantity, int id=-1)
 Add an item asset.
Tribe::AssetAddAsset (Tribe::AssetType type, csString name, csVector3 position, iSector *sector, Tribe::AssetStatus status)
 Add an asset to the tribe.
void AddCyclicRecipe (Recipe *recipe, int time)
 Add a cyclic recipe.
void AddKnowledge (csString knowHow)
 Add a knowledge token.
bool AddMember (PID pid, const char *tribeMemberType)
 Adds a new member to the tribe.
void AddMemory (csString name, const csVector3 &pos, iSector *sector, float radius, NPC *npc)
 Add a new memory to the tribe.
void AddRecipe (Recipe *recipe, Recipe *parentRecipe, bool reqType=false)
 Add a recipe.
void AddResource (csString resource, int amount, csString nick="")
 Add a new resource to the tribe resource table.
void Advance (csTicks when, EventManager *eventmgr)
 Advance the tribe.
int AliveCount () const
 Count number of alive members.
size_t AssetQuantity (Tribe::AssetType type, csString name)
 Return the quanitity of the given asset type matching the name.
bool AttachMember (NPC *npc, const char *tribeMemberType)
 Attach a new member to the tribe.
void Build (NPC *npc, bool pickupable)
 Build a building on the current NPC building spot.
bool CanGrow () const
 Check if the tribe can grow by checking the tribes wealth.
bool CheckAsset (Tribe::AssetType type, csString name, int number)
 Check to see if enough assets are available.
bool CheckAttach (NPC *npc)
 Attach a new member to the tribe if the NPC is a member.
bool CheckKnowledge (csString knowHow)
 Check if knowledge is known.
bool CheckMembers (const csString &type, int number)
 Check to see if enough members are idle.
bool CheckResource (csString resource, int number)
 Check to see if enough resources are available.
bool CheckWithinBoundsTribeHome (NPC *npc, const csVector3 &pos, const iSector *sector)
 Check if the position is within the bounds of the tribe home.
int CountResource (csString resource) const
 Return the amount of a given resource.
void DeleteAsset (csString name, int quantity)
 Delete item assets.
void DeleteAsset (csString name, csVector3 pos)
 Delete a building asset.
void DeleteCyclicRecipe (Recipe *recipe)
 Delete a cyclic recipe.
void DumpAssets ()
 Dump Assets.
void DumpBuffers ()
 Dump Buffers.
void DumpKnowledge ()
 Dump knowledge to console.
void DumpRecipesToConsole ()
 Dumps all information about recipes to console.
MemoryFindMemory (csString name, const csVector3 &pos, iSector *sector, float radius)
 Find a memory.
MemoryFindMemory (csString name)
 Find a memory.
MemoryFindNearestMemory (const char *name, const csVector3 &pos, const iSector *sector, float range=-1.0, float *foundRange=NULL)
 Find nearest memory to a position.
MemoryFindPrivMemory (csString name, const csVector3 &pos, iSector *sector, float radius, NPC *npc)
 Find a privat memory.
MemoryFindRandomMemory (const char *name, const csVector3 &pos, const iSector *sector, float range=-1.0, float *foundRange=NULL)
 Find a random memory within range to a position.
void ForgetMemories (NPC *npc)
 Forget privat memories.
AssetGetAsset (uint32_t itemUID)
 Get asset.
AssetGetAsset (Tribe::AssetType type, csString name)
 Get asset.
AssetGetAsset (Tribe::AssetType type, csString name, csVector3 where, iSector *sector)
 Get an asset based on name and position.
AssetGetAsset (Tribe::AssetType type, csString name, Tribe::AssetStatus status)
 Get asset.
AssetGetAsset (gemNPCItem *item)
 Get asset.
csString GetBuffer (const csString &bufferName)
 Return a named buffer from the NPC.
float GetDeathRate ()
 Retrive death rate average value from tribe.
void GetHome (csVector3 &pos, float &radius, iSector *&sector)
 Get home position for the tribe.
csVector3 GetHomePosition ()
iSector * GetHomeSector ()
csString GetHomeSectorName ()
int GetID ()
int GetMaxSize () const
 Calculate the maximum number of members for the tribe.
NPCGetMember (size_t i)
size_t GetMemberCount ()
size_t GetMemberIDCount ()
csList< Memory * >::Iterator GetMemoryIterator ()
gemNPCActorGetMostHated (NPC *npc, float range, bool includeOutsideRegion, bool includeInvisible, bool includeInvincible, float *hate=NULL)
 Find the most hated entity for tribe within range.
const char * GetName ()
AssetGetNearestAsset (Tribe::AssetType type, Tribe::AssetStatus status, csVector3 pos, iSector *sector, float range, float *locatedRange=NULL)
 Get nearest asset.
AssetGetNearestAsset (Tribe::AssetType type, csString name, Tribe::AssetStatus status, csVector3 pos, iSector *sector, float range, float *locatedRange=NULL)
 Get an asset.
const char * GetNeededResource ()
 Get the most needed resource for this tribe.
const char * GetNeededResourceAreaType ()
 Get a area for the most needed resource for this tribe.
const char * GetNeededResourceNick ()
 Get the nick for the most needed resource for this tribe.
csString GetNPCIdleBehavior ()
AssetGetRandomAsset (Tribe::AssetType type, csString name, Tribe::AssetStatus status, csVector3 pos, iSector *sector, float range)
 Get an asset.
AssetGetRandomAsset (Tribe::AssetType type, Tribe::AssetStatus status, csVector3 pos, iSector *sector, float range)
 Get a random asset.
int GetReproductionCost () const
 Return the reproduction cost for this tribe.
bool GetResource (NPC *npc, csVector3 startPos, iSector *startSector, csVector3 &pos, iSector *&sector, float range, bool random)
 Get a memorized location for resources.
Tribe::MemoryGetResource (csString resourceName, NPC *npc)
 Get the closest Memory regarding a resource or the closest non-prospected mine.
const ResourceGetResource (size_t n)
size_t GetResourceCount ()
float GetResourceRate ()
 Retrive resource rate average value from tribe.
RecipeGetTribalRecipe ()
 Get the main recipe.
float GetWealthResourceGrowth () const
 Get wealth resource growth rate.
float GetWealthResourceGrowthActive () const
 Get wealth resource growth rate active.
int GetWealthResourceGrowthActiveLimit () const
 Get wealth resource growth active limit.
bool HandleDeath (NPC *npc)
 Remove members that die.
void HandlePerception (NPC *npc, Perception *perception)
 Handled a perception given to this tribe.
void HandlePersistItem (gemNPCItem *item)
 Handle persist items that should be assets.
bool Load (iResultRow &row)
 Load the tribe object.
void LoadAsset (iResultRow &row)
 Load an asset from an iResultRow.
bool LoadMember (iResultRow &row)
 Load and add a new member to the tribe.
bool LoadMemory (iResultRow &row)
 Load all stored memories from db.
void LoadNPCMemoryBuffer (Tribe::Memory *memory, csArray< NPC * > npcs)
 Set npcs memory buffers - Using a memory.
bool LoadNPCMemoryBuffer (const char *name, csArray< NPC * > npcs)
 Set npcs memory buffers.
bool LoadResource (iResultRow &row)
 Load and add a new resource to the tribe.
void Memorize (NPC *npc, Perception *perception)
 Memorize a perception.
void ModifyWait (Recipe *recipe, int delta)
 Modify Wait Time for a recipe.
void ProspectMine (NPC *npc, csString resource, csString nick)
 Assigned a resource to a prospect Mine.
void RemoveAsset (Tribe::Asset *asset)
 Remove an asset.
void ReplaceBuffers (csString &result)
 Replace $TBUFFER[x] with values from the NPC buffer.
void SaveAsset (Tribe::Asset *asset, bool deletion=false)
 Save an asset to the db - responsable for deleting assets to.
void SaveKnowledge (csString knowHow)
 Save a knowledge piece in the database.
void SaveMemory (Memory *memory)
 Save a memory to the db.
void SaveResource (Resource *resource, bool newResource)
 Save or update an resource in database.
virtual void ScopedTimerCallback (const ScopedTimer *timer)
 Callback for debug of long time used in scopes.
csArray< NPC * > SelectNPCs (const csString &type, const char *number)
 Returns pointers to required npcs for a task.
void SendPerception (const char *pcpt, csArray< NPC * > npcs)
 Sends the given perception to the given list of npcs.
void SendPerception (const char *pcpt)
 Sends the given perception to the tribe.
void SetBuffer (const csString &bufferName, const csString &value)
 Set/Update the value of a named buffer.
void SetHome (const csVector3 &pos, float radius, iSector *sector)
 Set home position for the tribe.
void SetRecipeManager (RecipeManager *rm)
 Sets the tribe's recipe manager.
void ShareMemories (NPC *npc)
 Share privat memories with the other npcs.
bool ShouldGrow () const
 Check if the tribe should grow by checking number of members against max size.
 Tribe (EventManager *eventmngr, RecipeManager *rm)
 Construct a new tribe object.
void TriggerEvent (Perception *pcpt, float maxRange=-1.0, csVector3 *basePos=NULL, iSector *baseSector=NULL)
 Send a perception to all members of the tribe.
void Unbuild (NPC *npc, gemNPCItem *building)
 Tear down a building.
void UpdateRecipeData (int delta)
 Updates recipe wait times.
virtual ~Tribe ()
 Destruct a tribe object.

Static Public Attributes

static const char * AssetStatusStr []
static const char * AssetTypeStr []

Detailed Description

Class used to define a Tribal Object.

Definition at line 65 of file tribe.h.


Member Typedef Documentation

typedef csHash<csString,csString> Tribe::BufferHash

Definition at line 68 of file tribe.h.


Member Enumeration Documentation

Enumerator:
ASSET_STATUS_NOT_APPLICABLE 
ASSET_STATUS_NOT_USED 
ASSET_STATUS_INCONSTRUCTION 
ASSET_STATUS_CONSTRUCTED 

Definition at line 78 of file tribe.h.

Enumerator:
ASSET_TYPE_ITEM 
ASSET_TYPE_BUILDING 
ASSET_TYPE_BUILDINGSPOT 

Definition at line 70 of file tribe.h.


Constructor & Destructor Documentation

Tribe::Tribe ( EventManager eventmngr,
RecipeManager rm 
)

Construct a new tribe object.

virtual Tribe::~Tribe ( ) [virtual]

Destruct a tribe object.


Member Function Documentation

void Tribe::AddAsset ( Tribe::AssetType  type,
csString  name,
gemNPCItem item,
int  quantity,
int  id = -1 
)

Add an item asset.

Tribe::Asset* Tribe::AddAsset ( Tribe::AssetType  type,
csString  name,
csVector3  position,
iSector *  sector,
Tribe::AssetStatus  status 
)

Add an asset to the tribe.

void Tribe::AddCyclicRecipe ( Recipe recipe,
int  time 
)

Add a cyclic recipe.

Cyclic recipes are executed once in a pre-defined quantum of time and are set with the highest priority.

Parameters:
recipeRecipe to add
timeTribe advances required to execute this cyclic recipe
void Tribe::AddKnowledge ( csString  knowHow) [inline]

Add a knowledge token.

Definition at line 554 of file tribe.h.

bool Tribe::AddMember ( PID  pid,
const char *  tribeMemberType 
)

Adds a new member to the tribe.

void Tribe::AddMemory ( csString  name,
const csVector3 &  pos,
iSector *  sector,
float  radius,
NPC npc 
)

Add a new memory to the tribe.

void Tribe::AddRecipe ( Recipe recipe,
Recipe parentRecipe,
bool  reqType = false 
)

Add a recipe.

Adds a recipe to activeRecipes array in respect of it's priority and cost.

Parameters:
recipeRecipe to add.
parentRecipeRecipe that requires the new recipe.
reqTypeTrue for meeting requirements distributed-way
void Tribe::AddResource ( csString  resource,
int  amount,
csString  nick = "" 
)

Add a new resource to the tribe resource table.

void Tribe::Advance ( csTicks  when,
EventManager eventmgr 
)

Advance the tribe.

int Tribe::AliveCount ( ) const

Count number of alive members.

size_t Tribe::AssetQuantity ( Tribe::AssetType  type,
csString  name 
)

Return the quanitity of the given asset type matching the name.

bool Tribe::AttachMember ( NPC npc,
const char *  tribeMemberType 
)

Attach a new member to the tribe.

void Tribe::Build ( NPC npc,
bool  pickupable 
)

Build a building on the current NPC building spot.

bool Tribe::CanGrow ( ) const

Check if the tribe can grow by checking the tribes wealth.

bool Tribe::CheckAsset ( Tribe::AssetType  type,
csString  name,
int  number 
)

Check to see if enough assets are available.

bool Tribe::CheckAttach ( NPC npc)

Attach a new member to the tribe if the NPC is a member.

bool Tribe::CheckKnowledge ( csString  knowHow)

Check if knowledge is known.

bool Tribe::CheckMembers ( const csString &  type,
int  number 
)

Check to see if enough members are idle.

bool Tribe::CheckResource ( csString  resource,
int  number 
)

Check to see if enough resources are available.

bool Tribe::CheckWithinBoundsTribeHome ( NPC npc,
const csVector3 &  pos,
const iSector *  sector 
)

Check if the position is within the bounds of the tribe home.

Parameters:
npcThe npc responsible for this checking
posThe position to check
sectorThe sector to check
Returns:
True if position is within bounds of the tribe home
int Tribe::CountResource ( csString  resource) const

Return the amount of a given resource.

void Tribe::DeleteAsset ( csString  name,
int  quantity 
)

Delete item assets.

void Tribe::DeleteAsset ( csString  name,
csVector3  pos 
)

Delete a building asset.

void Tribe::DeleteCyclicRecipe ( Recipe recipe)

Delete a cyclic recipe.

void Tribe::DumpAssets ( )

Dump Assets.

void Tribe::DumpBuffers ( )

Dump Buffers.

void Tribe::DumpKnowledge ( )

Dump knowledge to console.

void Tribe::DumpRecipesToConsole ( )

Dumps all information about recipes to console.

Memory* Tribe::FindMemory ( csString  name,
const csVector3 &  pos,
iSector *  sector,
float  radius 
)

Find a memory.

Memory* Tribe::FindMemory ( csString  name)

Find a memory.

Memory* Tribe::FindNearestMemory ( const char *  name,
const csVector3 &  pos,
const iSector *  sector,
float  range = -1.0,
float foundRange = NULL 
)

Find nearest memory to a position.

Memory* Tribe::FindPrivMemory ( csString  name,
const csVector3 &  pos,
iSector *  sector,
float  radius,
NPC npc 
)

Find a privat memory.

Memory* Tribe::FindRandomMemory ( const char *  name,
const csVector3 &  pos,
const iSector *  sector,
float  range = -1.0,
float foundRange = NULL 
)

Find a random memory within range to a position.

void Tribe::ForgetMemories ( NPC npc)

Forget privat memories.

Should be called when npc die.

Asset* Tribe::GetAsset ( Tribe::AssetType  type,
csString  name,
csVector3  where,
iSector *  sector 
)

Get an asset based on name and position.

Asset* Tribe::GetAsset ( Tribe::AssetType  type,
csString  name 
)

Get asset.

Asset* Tribe::GetAsset ( Tribe::AssetType  type,
csString  name,
Tribe::AssetStatus  status 
)

Get asset.

Asset* Tribe::GetAsset ( gemNPCItem item)

Get asset.

Asset* Tribe::GetAsset ( uint32_t  itemUID)

Get asset.

csString Tribe::GetBuffer ( const csString &  bufferName)

Return a named buffer from the NPC.

Function used to get data from buffers containing information.

Parameters:
bufferNameThe name of the buffer to retrive.
Returns:
Buffer value
float Tribe::GetDeathRate ( ) [inline]

Retrive death rate average value from tribe.

Returns:
The Exponential smoothed death rate.

Definition at line 490 of file tribe.h.

void Tribe::GetHome ( csVector3 &  pos,
float radius,
iSector *&  sector 
)

Get home position for the tribe.

csVector3 Tribe::GetHomePosition ( ) [inline]

Definition at line 262 of file tribe.h.

iSector* Tribe::GetHomeSector ( )
csString Tribe::GetHomeSectorName ( ) [inline]

Definition at line 267 of file tribe.h.

int Tribe::GetID ( ) [inline]

Definition at line 225 of file tribe.h.

int Tribe::GetMaxSize ( ) const

Calculate the maximum number of members for the tribe.

NPC* Tribe::GetMember ( size_t  i) [inline]

Definition at line 241 of file tribe.h.

size_t Tribe::GetMemberCount ( ) [inline]

Definition at line 237 of file tribe.h.

size_t Tribe::GetMemberIDCount ( ) [inline]

Definition at line 233 of file tribe.h.

csList<Memory*>::Iterator Tribe::GetMemoryIterator ( ) [inline]

Definition at line 253 of file tribe.h.

gemNPCActor* Tribe::GetMostHated ( NPC npc,
float  range,
bool  includeOutsideRegion,
bool  includeInvisible,
bool  includeInvincible,
float hate = NULL 
)

Find the most hated entity for tribe within range.

Check the hate list and retrive most hated entity within range of the given NPC.

Parameters:
npcThe senter of the search.
rangeThe range to search for hated entities.
includeOutsideRegionInclude outside region entities in the search.
includeInvisibleInclude invisible entities in the search.
includeInvincibleInclude invincible entities in the search.
hateIf diffrent from NULL, set upon return to the hate of the hated.
Returns:
The hated entity
const char* Tribe::GetName ( ) [inline]

Definition at line 229 of file tribe.h.

Asset* Tribe::GetNearestAsset ( Tribe::AssetType  type,
Tribe::AssetStatus  status,
csVector3  pos,
iSector *  sector,
float  range,
float locatedRange = NULL 
)

Get nearest asset.

Asset* Tribe::GetNearestAsset ( Tribe::AssetType  type,
csString  name,
Tribe::AssetStatus  status,
csVector3  pos,
iSector *  sector,
float  range,
float locatedRange = NULL 
)

Get an asset.

const char* Tribe::GetNeededResource ( )

Get the most needed resource for this tribe.

const char* Tribe::GetNeededResourceAreaType ( )

Get a area for the most needed resource for this tribe.

const char* Tribe::GetNeededResourceNick ( )

Get the nick for the most needed resource for this tribe.

csString Tribe::GetNPCIdleBehavior ( ) [inline]

Definition at line 258 of file tribe.h.

Asset* Tribe::GetRandomAsset ( Tribe::AssetType  type,
Tribe::AssetStatus  status,
csVector3  pos,
iSector *  sector,
float  range 
)

Get a random asset.

Asset* Tribe::GetRandomAsset ( Tribe::AssetType  type,
csString  name,
Tribe::AssetStatus  status,
csVector3  pos,
iSector *  sector,
float  range 
)

Get an asset.

int Tribe::GetReproductionCost ( ) const

Return the reproduction cost for this tribe.

Tribe::Memory* Tribe::GetResource ( csString  resourceName,
NPC npc 
)

Get the closest Memory regarding a resource or the closest non-prospected mine.

const Resource& Tribe::GetResource ( size_t  n) [inline]

Definition at line 249 of file tribe.h.

bool Tribe::GetResource ( NPC npc,
csVector3  startPos,
iSector *  startSector,
csVector3 &  pos,
iSector *&  sector,
float  range,
bool  random 
)

Get a memorized location for resources.

size_t Tribe::GetResourceCount ( ) [inline]

Definition at line 245 of file tribe.h.

float Tribe::GetResourceRate ( ) [inline]

Retrive resource rate average value from tribe.

Returns:
The Exponential smoothed resource rate.

Definition at line 500 of file tribe.h.

Recipe* Tribe::GetTribalRecipe ( )

Get the main recipe.

float Tribe::GetWealthResourceGrowth ( ) const

Get wealth resource growth rate.

Get the rate that the wealth will grow when all members are dead.

Returns:
Return the wealth growth rate
float Tribe::GetWealthResourceGrowthActive ( ) const

Get wealth resource growth rate active.

Get the rate that the wealth will grow when there are alive members.

Returns:
Return the wealth growth rate
int Tribe::GetWealthResourceGrowthActiveLimit ( ) const

Get wealth resource growth active limit.

Get the limit that the wealth will be capped at when there are alive members.

Returns:
Return the wealth growth limit
bool Tribe::HandleDeath ( NPC npc)

Remove members that die.

void Tribe::HandlePerception ( NPC npc,
Perception perception 
)

Handled a perception given to this tribe.

void Tribe::HandlePersistItem ( gemNPCItem item)

Handle persist items that should be assets.

bool Tribe::Load ( iResultRow &  row)

Load the tribe object.

void Tribe::LoadAsset ( iResultRow &  row)

Load an asset from an iResultRow.

bool Tribe::LoadMember ( iResultRow &  row)

Load and add a new member to the tribe.

bool Tribe::LoadMemory ( iResultRow &  row)

Load all stored memories from db.

void Tribe::LoadNPCMemoryBuffer ( Tribe::Memory memory,
csArray< NPC * >  npcs 
)

Set npcs memory buffers - Using a memory.

bool Tribe::LoadNPCMemoryBuffer ( const char *  name,
csArray< NPC * >  npcs 
)

Set npcs memory buffers.

Loads locations into the Memory buffers of the npcs. Useful when assigning tasks to them.

Parameters:
nameName of the memory/resource to load.
npcsLink to the npcs on which to load.
Returns:
False if no desired location exists.
bool Tribe::LoadResource ( iResultRow &  row)

Load and add a new resource to the tribe.

void Tribe::Memorize ( NPC npc,
Perception perception 
)

Memorize a perception.

The perception will be marked as personal until NPC return home. Personal perceptions will be deleted if NPC die.

void Tribe::ModifyWait ( Recipe recipe,
int  delta 
)

Modify Wait Time for a recipe.

void Tribe::ProspectMine ( NPC npc,
csString  resource,
csString  nick 
)

Assigned a resource to a prospect Mine.

Upon 'Explore' behavior, tribe members may find locations named 'mine'. After mining from an unkown deposit, the npcclient will receive a psWorkDoneMessage telling it what his npc just mined. This function renames the former 'mine' Memory with it's real deposit name.

Parameters:
npcThe npc who prospected it to access his memoryBuffer.
resourceThe resulted resource received from psServer.
nickThe nick name of the resource for this mine.
void Tribe::RemoveAsset ( Tribe::Asset asset)

Remove an asset.

void Tribe::ReplaceBuffers ( csString &  result)

Replace $TBUFFER[x] with values from the NPC buffer.

Parameters:
resultString to replace buffers in.
void Tribe::SaveAsset ( Tribe::Asset asset,
bool  deletion = false 
)

Save an asset to the db - responsable for deleting assets to.

void Tribe::SaveKnowledge ( csString  knowHow)

Save a knowledge piece in the database.

void Tribe::SaveMemory ( Memory memory)

Save a memory to the db.

void Tribe::SaveResource ( Resource resource,
bool  newResource 
)

Save or update an resource in database.

virtual void Tribe::ScopedTimerCallback ( const ScopedTimer timer) [virtual]

Callback for debug of long time used in scopes.

Implements ScopedTimerCB.

csArray<NPC*> Tribe::SelectNPCs ( const csString &  type,
const char *  number 
)

Returns pointers to required npcs for a task.

void Tribe::SendPerception ( const char *  pcpt)

Sends the given perception to the tribe.

Used to send perceptions to all tribe members.

Parameters:
pcptThe perception name to be sent
void Tribe::SendPerception ( const char *  pcpt,
csArray< NPC * >  npcs 
)

Sends the given perception to the given list of npcs.

Used by the recipe manager to send perceptions to tribe members selected by the active recipe.

Parameters:
pcptThe perception name to be sent
npcsThe list of npcs to send perception to.
void Tribe::SetBuffer ( const csString &  bufferName,
const csString &  value 
)

Set/Update the value of a named buffer.

Parameters:
bufferNameThe buffer name.
valueThe value to put in the buffer.
void Tribe::SetHome ( const csVector3 &  pos,
float  radius,
iSector *  sector 
)

Set home position for the tribe.

void Tribe::SetRecipeManager ( RecipeManager rm) [inline]

Sets the tribe's recipe manager.

Definition at line 508 of file tribe.h.

void Tribe::ShareMemories ( NPC npc)

Share privat memories with the other npcs.

Should be called when npc return to home.

bool Tribe::ShouldGrow ( ) const

Check if the tribe should grow by checking number of members against max size.

void Tribe::TriggerEvent ( Perception pcpt,
float  maxRange = -1.0,
csVector3 *  basePos = NULL,
iSector *  baseSector = NULL 
)

Send a perception to all members of the tribe.

This will send the perception to all the members of the tribe. If the maxRange has been set to something greater than 0.0 a range check will be applied. Only members within the range from the base position and sector will be triggered.

Parameters:
pcptPerception to be sent.
maxRangeIf greater then 0.0 then max range apply
basePosThe base position for range checks.
baseSectorThe base sector for range checks.
void Tribe::Unbuild ( NPC npc,
gemNPCItem building 
)

Tear down a building.

void Tribe::UpdateRecipeData ( int  delta)

Updates recipe wait times.


Member Data Documentation

const char* Tribe::AssetStatusStr[] [static]

Definition at line 85 of file tribe.h.

const char* Tribe::AssetTypeStr[] [static]

Definition at line 76 of file tribe.h.


The documentation for this class was generated from the following file: