Files
ogre-prototype/src/gamedata/VehicleManagerModule.cpp

24 lines
626 B
C++

#include "Components.h"
#include "GameData.h"
#include "BoatModule.h"
#include "VehicleManagerModule.h"
namespace ECS
{
VehicleManagerModule::VehicleManagerModule(flecs::world &ecs)
{
ecs.module<VehicleManagerModule>();
ecs.import <BoatModule>();
}
flecs::entity VehicleManagerModule::createVehicleAtPosition(
const Ogre::String &name, const Ogre::Vector3 &position,
const Ogre::Quaternion &orientation)
{
flecs::entity vehicle = ECS::get().entity();
if (name == "boat")
vehicle.set<BoatType>(
{ name + ".scene", position, orientation });
else
OgreAssert(false, "unsupported type: " + name);
return vehicle;
}
}