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,54 @@
#include "stdafx.h"
#include "WorldObjectTreeNode.h"
WorldObjectTreeNode::WorldObjectTreeNode()
{
parent = left = right = NULL;
key = 0;
objectType = L2OT_NONE;
arrayIdx = -1;
pObj = NULL;
}
void WorldObjectTreeNode::setFrom( const WorldObjectTreeNode *other )
{
objectType = other->objectType;
arrayIdx = other->arrayIdx;
pObj = other->pObj;
}
void WorldObjectTreeNode::setPlayer( L2Player *player )
{
objectType = L2OT_PC;
pObj = dynamic_cast<L2Object *>(player);
}
void WorldObjectTreeNode::setNpc( L2Npc *npc )
{
objectType = L2OT_NPC;
pObj = dynamic_cast<L2Object *>(npc);
}
void WorldObjectTreeNode::setGroundItem( GroundItem *item )
{
objectType = L2OT_ITEM;
pObj = dynamic_cast<L2Object *>(item);
}
L2Player *WorldObjectTreeNode::cast_L2Player() const
{
if( this->objectType != L2OT_PC ) return NULL;
return (L2Player *)(this->pObj);
}
L2Npc *WorldObjectTreeNode::cast_L2Npc() const
{
if( this->objectType != L2OT_NPC ) return NULL;
return (L2Npc *)this->pObj;
}
GroundItem *WorldObjectTreeNode::cast_GroundItem() const
{
if( this->objectType != L2OT_ITEM ) return NULL;
return (GroundItem *)this->pObj;
}