117 lines
2.5 KiB
C++
117 lines
2.5 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"
|
|
#include "dummyentity.h"
|
|
#include "mapblock.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;
|
|
}
|
|
|
|
Building* EntityFactory::MakeBuilding(int entity_uniid)
|
|
{
|
|
Building* building = new Building();
|
|
building->uniid_ = entity_uniid;
|
|
building->entity_type_ = ET_Building;
|
|
return building;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
DummyEntity* EntityFactory::MakeDummy(int entity_uniid)
|
|
{
|
|
DummyEntity* dummy = new DummyEntity();
|
|
dummy->uniid_ = entity_uniid;
|
|
dummy->entity_type_ = ET_Dummy;
|
|
return dummy;
|
|
}
|
|
|
|
MapBlock* EntityFactory::MakeBlock(int entity_uniid)
|
|
{
|
|
MapBlock* p = new MapBlock();
|
|
p->uniid_ = entity_uniid;
|
|
p->entity_type_ = ET_MapBlock;
|
|
return p;
|
|
}
|