Difference between revisions of "Entity Functions"

From theFarWilds
Jump to: navigation, search
Line 17: Line 17:
 
  bool '''doesExist'''();
 
  bool '''doesExist'''();
 
  // check to see if entity has been removed
 
  // check to see if entity has been removed
 
+
 
  string '''getName'''();
 
  string '''getName'''();
 
   
 
   
Line 41: Line 41:
 
   
 
   
 
  bool '''isDim'''();
 
  bool '''isDim'''();
 +
 +
int '''addTokens'''(string tokenName,int delta);
 +
// returns the number of that token after the add.
 +
// delta can be negative
 +
 +
int '''numTokens'''(string tokenName);
 +
 +
string '''otherName'''();
 +
// returns the name of the corpse, ruin,
 +
// or construction site building that this was or will be

Revision as of 12:56, 6 April 2010

Each entity object represents a creature, building, enchantment, corpse, or ruin. Collectively, these objects define the current game state.

Constructors

Entity createEntity( string cardName, int x_coord, int y_coord, Player controller );

Entity createEntity( string cardName, Location loc, Player controller );

Entity createEntity( string cardName, Location loc );

See also getFigure( Location loc ).

Methods

bool isValid();
// check to see if entity was created successfully

bool doesExist();
// check to see if entity has been removed

string getName();

Player getController();

void setController( Player controller );

bool isType( int type );
// Types: CREATURE=1, BUILDING=2, ENCHANTMENT=3, ITEM=4, MARKER(Corpse,Flux Well,Ruin)=5, WORLD_ENCHANT=6

Location getLoc();

bool moveEntity( Location );
// returns false if unsuccessful (e.g., trying to move figure into occupied location)

void remove();

void destroy();

void sacrifice();

void setDim( bool dimOrNot );

bool isDim();

int addTokens(string tokenName,int delta);
// returns the number of that token after the add.
// delta can be negative

int numTokens(string tokenName);

string otherName();
// returns the name of the corpse, ruin, 
// or construction site building that this was or will be