Skip to content

File WavePatterns.hpp

File List > Engine > include > Utils > WavePatterns.hpp

Go to the documentation of this file

#ifndef WAVE_PATTERNS_HPP_
#define WAVE_PATTERNS_HPP_

#include "Components/ColliderComponent.hpp"
#include "Components/Position.hpp"
#include "Components/SpriteComponent.hpp"
#include "ECS/Registry.hpp"
#include "Resources/PrefabSpawner.hpp"
#include <string>
#include <vector>

namespace Engine {

struct EntityBounds {
    float width;
    float height;
    float offsetX; // optional offset from entity origin to bounding box
    float offsetY;
};

enum class WavePatternType {
    Line,
    VFormation,
    Sine,
    Grid,
    Custom // placeholder for future patterns
};

struct WaveConfig {
    WavePatternType pattern;
    std::string prefabPath;
    unsigned int count;           // number of entities
    float spacing;                // distance between entities along pattern axis
    bool attachParent;            // if true, spawn a dummy parent entity and attach children
    std::string parentScriptPath; // optional script for parent entity
    // Additional parameters can be added as needed
};

EntityBounds GetEntitySize(Registry& registry, Entity entity);

std::vector<Entity> SpawnWaveFormation(Registry& registry, const WaveConfig& config);

} // namespace Engine
#endif