Char Class Reference

#include <Char.h>

Inheritance diagram for Char:

IMoveableObject IGameObject List of all members.

Public Member Functions

 Char (Uint32 serial, Uint16 type, Uint32 dbId)
virtual ~Char ()
void update ()

Private Attributes

Uint32 myId

Detailed Description

Represents a playing character. This is only for a real player chracter, NPC have their own class.

Definition at line 11 of file Char.h.


Constructor & Destructor Documentation

Char::Char Uint32  serial,
Uint16  type,
Uint32  dbId
 

Temporary constructor implementation. To be finished.

Parameters:
serial A valid, unique serial.
type The object type.
dbId Database id of the character.

Definition at line 5 of file Char.cpp.

References Logger::getInstance(), Logger::log(), IGameObject::setName(), and IGameObject::setPosition().

00006     :IMoveableObject(serial, type),
00007     myId(dbId)
00008 {
00009     CppSQLite3DB accDb;
00010     accDb.open("accounts.db");
00011 
00012     std::ostringstream oss;
00013     oss << myId;
00014     std::string query = "SELECT * FROM characters WHERE id = \""+oss.str()+"\";";
00015     CppSQLite3Query q = accDb.execQuery(query.c_str());
00016 
00017     if (!q.eof()){
00018         setName(q.fieldValue(2));
00019         setPosition(Location(q.getIntField(3),q.getIntField(4),0));
00020     }
00021     else{
00022         Logger::getInstance()->log("Error creating Character with ID "+oss.str(), LOGMODE_DB);
00023     }
00024 
00025     accDb.close();
00026 }

Char::~Char  )  [virtual]
 

Virtual destructor.

Definition at line 28 of file Char.cpp.

00029 {
00030     //dtor
00031 }


Member Function Documentation

void Char::update  )  [virtual]
 

Updates the char.

Author:
stonedz
Since:
pre-alpha
Todo:
To be implemented.

Implements IGameObject.

Definition at line 33 of file Char.cpp.

00033                  {
00034 
00035 }


Member Data Documentation

Uint32 Char::myId [private]
 

Character Database unique Id, this is NOT the serial.

Definition at line 39 of file Char.h.


The documentation for this class was generated from the following files:
Generated on Mon Dec 3 04:30:13 2007 for lo-testserver by  doxygen 1.3.9.1