Class from whom most of the other class derive from, derive from IEventReceiver. More...
#include <base.h>
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 | |
coeur * | mycore |
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. |
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.
base::base | ( | stringc | name = stringc("base") |
) |
Constructor.
Construct the base initiate base::nameClass to name and base::initialize to false
name | Name of the class(needed for logging) |
Definition at line 35 of file base.cpp.
References initialize, and nameClass.
int base::close | ( | ) | [virtual] |
Close the base.
Close the log and put base::initialize to false
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
Id | Id of the class | |
c | Pointer to the core |
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 | ) |
Log some text.
Send text to the logger to log it in the proper file
text | text to log(pure text, time and \n will be add letter) |
Definition at line 88 of file base.cpp.
References coeur::getLogger(), logId, mycore, and logger::write().
Referenced by lieu::addAnimateMesh(), local::addCombinaison(), interface::addInventaire(), chap::addItem(), interface::addItemInventaire(), credit::addLogo(), coeur::addMesh(), local::addObservationItem(), local::addObservationMesh(), lieu::addObservationMesh(), lieu::addPrendreMesh(), lieu::addStaticMesh(), credit::addText(), local::close(), lieu::close(), interface::close(), credit::close(), coeur::close(), chap::close(), close(), logger::closeFile(), logger::createFile(), pyInt::eval(), pyInt::exec(), console::exit(), console::fps(), coeur::getTexture(), console::help(), local::init(), lieu::init(), interface::init(), credit::init(), console::init(), coeur::init(), chap::init(), init(), coeur::loadChap(), coeur::loadLieu(), coeur::loadLocal(), interface::OnEvent(), console::OnEvent(), coeur::play(), console::position(), console::quit(), console::rotation(), coeur::setCaption(), credit::start(), credit::stop(), console::target(), and coeur::update().
int base::update | ( | ) | [virtual] |
int base::id [private] |
bool base::initialize [private] |
int base::logId [private] |
coeur* base::mycore [protected] |
Pointer to the core.
Definition at line 56 of file base.h.
Referenced by lieu::addAnimateMesh(), interface::addInventaire(), inventaire::addItem(), credit::addLogo(), lieu::addObservationMesh(), lieu::addPrendreMesh(), lieu::addStaticMesh(), credit::addText(), console::close(), close(), console::help(), lieu::init(), inventaire::init(), interface::init(), console::init(), init(), log(), interface::OnEvent(), console::OnEvent(), console::position(), console::quit(), console::rotation(), interface::setImage(), interface::speak(), credit::start(), console::target(), interface::update(), and logger::write().
stringc base::nameClass [private] |