#include "EnemyFactory.h" #include #include #include "ConstantVelocity.h" #include "Enemy.h" #include "ExampleGenerator.h" #include "FallingAndOscillating.h" #include "WaveGenerator.h" Enemy EnemyFactory::make_example( ConstantVelocityBullet::Vector& bullets, const float x, const float y, const float hold, const bool mirror) { auto position = std::make_shared(Vector2{x, y}); auto generator = std::make_shared(position, bullets); auto behaviour = std::make_shared(position, generator); if (mirror) { generator->m_color = Color{100, 0, 255, 255}; generator->m_direction *= -1; behaviour->m_phase = 1.f; } Enemy enemy(position, generator, behaviour); enemy.m_hold = hold; return enemy; } Enemy EnemyFactory::make_waver( ConstantVelocityBullet::Vector& bullets, const float x, const float y, const float hold) { auto position = std::make_shared(Vector2{x, y}); auto generator = std::make_shared(position, bullets); auto behaviour = std::make_shared(position, generator); Enemy enemy(position, generator, behaviour); enemy.m_hold = hold; return enemy; }