Initial MSVC 2008 projects workspace

This commit is contained in:
alexey.min
2012-02-01 05:25:08 +00:00
commit 03de3bdc95
1446 changed files with 476853 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
#include "pch.h"
#include "GameCharacter.h"
GameCharacter::GameCharacter( unsigned int objectId ): GameObject( objectId )
{
m_name = NULL;
}
GameCharacter::~GameCharacter()
{
if( m_name )
{
free( m_name );
m_name = NULL;
}
GameObject::~GameObject();
}
void GameCharacter::setName( const wchar_t *name )
{
if( m_name ) free( m_name );
m_name = NULL;
if( name ) m_name = _wcsdup( name );
}
void GameCharacter::setLevel( int level )
{
m_level = level;
if( m_level < 0 ) m_level = 0;
}
const wchar_t *GameCharacter::getName() const
{
return (const wchar_t *)m_name;
}
wchar_t *GameCharacter::toString() const
{
GameCharacter *nc_this = const_cast<GameCharacter *>(this);
if( !nc_this->m_toString_buffer )
nc_this->m_toString_buffer = (wchar_t *)malloc( 512 );
if( nc_this->m_toString_buffer )
swprintf( nc_this->m_toString_buffer, 255, L"%s lvl %d [oid %u]", m_name, m_level, m_objectId );
return m_toString_buffer;
}

View File

@@ -0,0 +1,24 @@
#pragma once
#include "../GameObject.h"
class GameCharacter: public GameObject
{
public:
GameCharacter( unsigned int objectId );
virtual ~GameCharacter();
public:
void setName( const wchar_t *name );
void setLevel( int level );
public:
const wchar_t *getName() const;
int getLevel() const { return m_level; }
public:
virtual wchar_t *toString() const;
protected:
wchar_t *m_name;
int m_level;
};

View File

@@ -0,0 +1,11 @@
#include "pch.h"
#include "GameNpc.h"
GameNpc::GameNpc( unsigned int objectId, int npcTemplateId ): GameCharacter( objectId )
{
m_npcTemplateId = npcTemplateId;
}
GameNpc::~GameNpc()
{
}

View File

@@ -0,0 +1,18 @@
#pragma once
#include "GameCharacter.h"
class GameNpc: public GameCharacter
{
public:
GameNpc( unsigned int objectId, int npcTemplateId );
virtual ~GameNpc();
public:
int getNpcTemplateId() const { return m_npcTemplateId; }
public:
void setNpcTemplateId( int tmplId ) { m_npcTemplateId = tmplId; }
protected:
int m_npcTemplateId;
};

View File

@@ -0,0 +1,19 @@
#include "pch.h"
#include "Log.h"
#include "../../../net/GameClient/GameClient.h"
#include "GamePlayer.h"
GamePlayer::GamePlayer( GameClient *clnt, unsigned int objectId ): GameCharacter( objectId )
{
m_gameClient = clnt;
}
GamePlayer::~GamePlayer()
{
m_gameClient = NULL;
}
GameClient *GamePlayer::getGameClient()
{
return m_gameClient;
}

View File

@@ -0,0 +1,16 @@
#pragma once
#include "GameCharacter.h"
class GameClient; // forward decl
class GamePlayer: public GameCharacter
{
public:
GamePlayer( GameClient *clnt, unsigned int objectId );
virtual ~GamePlayer();
public:
GameClient *getGameClient();
protected:
GameClient *m_gameClient;
};