game2006/server/gameserver/entityfactory.cc
2022-12-14 17:11:56 +08:00

97 lines
2.0 KiB
C++

#include "precompile.h"
#include "entityfactory.h"
#include "obstacle.h"
#include "roomobstacle.h"
#include "loot.h"
#include "bullet.h"
#include "android.h"
#include "player.h"
#include "car.h"
#include "hero.h"
#include "explosion.h"
void EntityFactory::Init()
{
}
void EntityFactory::UnInit()
{
}
Obstacle* EntityFactory::MakeObstacle(int entity_uniid)
{
Obstacle* obstacle = new Obstacle();
obstacle->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->uniid_ = entity_uniid;
obstacle->entity_type_ = ET_Obstacle;
obstacle->entity_subtype_ = EST_RoomObstacle;
return obstacle;
}
Loot* EntityFactory::MakeLoot(int entity_uniid)
{
Loot* loot = new Loot();
loot->uniid_ = entity_uniid;
loot->entity_type_ = ET_Loot;
return loot;
}
Bullet* EntityFactory::MakeBullet(int entity_uniid)
{
Bullet* bullet = new Bullet();
bullet->uniid_ = entity_uniid;
bullet->entity_type_ = ET_Bullet;
return bullet;
}
Android* EntityFactory::MakeAndroid(int entity_uniid)
{
Android* hum = new Android();
hum->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->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->uniid_ = entity_uniid;
hum->entity_type_ = ET_Car;
return hum;
}
Hero* EntityFactory::MakeHero(int entity_uniid)
{
Hero* hum = new Hero();
hum->uniid_ = entity_uniid;
hum->entity_type_ = ET_Hero;
return hum;
}
std::shared_ptr<Explosion> EntityFactory::MakeExplosion()
{
std::shared_ptr<Explosion> e(new Explosion);
return e;
}