base Class Reference

Class from whom most of the other class derive from, derive from IEventReceiver. More...

#include <base.h>

Inheritance diagram for base:
chap coeur console credit interface inventaire lieu local logger pyInt

List of all members.

Public Member Functions

 base (stringc=stringc("base"))
 Constructor.
 ~base ()
 Destructor.
virtual int init (int, coeur *)
 Init the base.
virtual int update ()
 Updating(should be call on each loop).
virtual int close ()
 Close the base.
int getId ()
 Return the base::id.
int log (stringc)
 Log some text.
bool isInit ()
 return base::initialize

Protected Attributes

coeurmycore
 Pointer to the core.

Private Attributes

int id
 Id of the class.
stringc nameClass
 Name of the class.
int logId
 Id of the log.
bool initialize
 Contain True if base initialized.

Detailed Description

Class from whom most of the other class derive from, derive from IEventReceiver.

Contain some basic feature needed by a lot of class.
This class handle more precisly the id, the name and the log function.
Derive from IEventReceiver, in order to be able to "surcharger" OnEvent() to handle events.

Definition at line 27 of file base.h.


Constructor & Destructor Documentation

base::base ( stringc  name = stringc("base")  ) 

Constructor.

Construct the base initiate base::nameClass to name and base::initialize to false

Parameters:
name Name of the class(needed for logging)

Definition at line 35 of file base.cpp.

References initialize, and nameClass.

base::~base (  ) 

Destructor.

Definition at line 41 of file base.cpp.


Member Function Documentation

int base::close (  )  [virtual]

Close the base.

Close the log and put base::initialize to false

Returns:
logger::closeFile()

Reimplemented in chap, coeur, console, credit, interface, inventaire, lieu, local, logger, and pyInt.

Definition at line 73 of file base.cpp.

References logger::closeFile(), coeur::getLogger(), initialize, log(), logId, mycore, and nameClass.

int base::getId (  ) 

Return the base::id.

Definition at line 80 of file base.cpp.

References id.

Referenced by inventaire::addItem(), inventaire::getFreePlace(), and inventaire::removeItem().

int base::init ( int  Id,
coeur c 
) [virtual]

Init the base.

Put base::mycore to c, base::id to Id, init the logger and put initialized to true

Parameters:
Id Id of the class
c Pointer to the core
Returns:
The id of the log (base::logId)

Definition at line 50 of file base.cpp.

References logger::createFile(), coeur::getLogger(), initialize, log(), logId, mycore, and nameClass.

bool base::isInit (  ) 

return base::initialize

Definition at line 93 of file base.cpp.

References initialize.

Referenced by coeur::loadChap(), coeur::loadLieu(), and coeur::loadLocal().

int base::log ( stringc  text  ) 
int base::update (  )  [virtual]

Updating(should be call on each loop).

Does nothing

Returns:
Always 0

Reimplemented in chap, coeur, console, credit, interface, inventaire, lieu, local, and pyInt.

Definition at line 66 of file base.cpp.


Member Data Documentation

int base::id [private]

Id of the class.

Definition at line 60 of file base.h.

Referenced by getId().

bool base::initialize [private]

Contain True if base initialized.

Definition at line 69 of file base.h.

Referenced by base(), close(), init(), and isInit().

int base::logId [private]

Id of the log.

Definition at line 66 of file base.h.

Referenced by close(), init(), and log().

coeur* base::mycore [protected]
stringc base::nameClass [private]

Name of the class.

Definition at line 63 of file base.h.

Referenced by base(), close(), and init().


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Enumerator Friends

Generated on Wed Sep 9 18:20:15 2009 for The Merry Turnip by  doxygen 1.6.1