game2005/server/gameserver/entityfactory.cc
aozhiwei e70e3b335e 1
2021-03-16 16:52:06 +08:00

99 lines
2.1 KiB
C++

#include "precompile.h"
#include "entityfactory.h"
#include "obstacle.h"
#include "roomobstacle.h"
#include "building.h"
#include "loot.h"
#include "bullet.h"
#include "android.h"
#include "player.h"
#include "car.h"
#include "hero.h"
void EntityFactory::Init()
{
}
void EntityFactory::UnInit()
{
}
Obstacle* EntityFactory::MakeObstacle(int entity_uniid)
{
Obstacle* obstacle = new Obstacle();
obstacle->entity_uniid_ = entity_uniid;
obstacle->entity_type_ = ET_Obstacle;
obstacle->entity_subtype_ = EST_PermanentObstacle;
return obstacle;
}
RoomObstacle* EntityFactory::MakeRoomObstacle(int entity_uniid)
{
RoomObstacle* obstacle = new RoomObstacle();
obstacle->entity_uniid_ = entity_uniid;
obstacle->entity_type_ = ET_Obstacle;
obstacle->entity_subtype_ = EST_RoomObstacle;
return obstacle;
}
Building* EntityFactory::MakeBuilding(int entity_uniid)
{
Building* building = new Building();
building->entity_uniid_ = entity_uniid;
building->entity_type_ = ET_Building;
return building;
}
Loot* EntityFactory::MakeLoot(int entity_uniid)
{
Loot* loot = new Loot();
loot->entity_uniid_ = entity_uniid;
loot->entity_type_ = ET_Loot;
return loot;
}
Bullet* EntityFactory::MakeBullet(int entity_uniid)
{
Bullet* bullet = new Bullet();
bullet->entity_uniid_ = entity_uniid;
bullet->entity_type_ = ET_Bullet;
return bullet;
}
Android* EntityFactory::MakeAndroid(int entity_uniid)
{
Android* hum = new Android();
hum->entity_uniid_ = entity_uniid;
hum->entity_type_ = ET_Player;
hum->entity_subtype_ = EST_Android;
return hum;
}
Player* EntityFactory::MakePlayer(int entity_uniid)
{
Player* hum = new Player();
hum->entity_uniid_ = entity_uniid;
hum->entity_type_ = ET_Player;
hum->entity_subtype_ = EST_Player;
return hum;
}
Car* EntityFactory::MakeCar(int entity_uniid)
{
Car* hum = new Car();
hum->entity_uniid_ = entity_uniid;
hum->entity_type_ = ET_Car;
return hum;
}
Hero* EntityFactory::MakeHero(int entity_uniid)
{
Hero* hum = new Hero();
hum->entity_uniid_ = entity_uniid;
hum->entity_type_ = ET_Hero;
return hum;
}