Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CEntity* PLevelEntityFactory::CreateEntity(ELevelEntityType entityType, const TVector2& position, const DLevelEntityProperties& properties)
- {
- if (entityType == ELevelEntityType::ENTITY_BLADE)
- {
- CEntityBlade* blade = new CEntityBlade(position);
- if (PROPERTY_EXISTS(ELevelEntityPropertyType::AREA))
- {
- blade->SetBladeArea(properties.at(ELevelEntityPropertyType::AREA).ToVector2());
- }
- return blade;
- }
- else if (entityType == ELevelEntityType::ENTITY_BLADE_SPINNER)
- {
- float bladeSpinnerRotation = 0.0f;
- if (PROPERTY_EXISTS(ELevelEntityPropertyType::BLADE_SPINNER_ROTATION))
- {
- bladeSpinnerRotation = properties.at(ELevelEntityPropertyType::BLADE_SPINNER_ROTATION).GetValue().ToFloat();
- }
- return new CEntityBladeSpinner(position, bladeSpinnerRotation);
- }
- else if (entityType == ELevelEntityType::ENTITY_BOSS_PRISON)
- {
- return new CEntityBossPrison(position);
- }
- return nullptr;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement