#pragma once

#include "def.h"
#include "object.h"

namespace render{
namespace fx{

class effect
{
friend class effectInfo;
public:
    vec2f pos;

    effect();
    ~effect();

    void start();
    void stop();
    void terminate();

    void update();
    void draw();

    bool isRunning();
    bool hasAliveParticles();

    bool looped;
private:
    bool running;
    const effectInfo *next;
    std::vector<objectRef> _objs;
};

class effectInfo
{
public:
    std::string id;
    std::string next;
    std::vector<objectRefInfo> objects;

    effect *create() const;
    bool looped;
    collection *root;
};

}}

