summaryrefslogtreecommitdiffhomepage
path: root/src/critter-script.hpp
blob: 75f8156d0c1b04e70b2eddd3859472aa0c8d77c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once
#include "script.hpp"
#include <memory>

namespace floormat {

struct critter;
struct Ns;

struct critter_script : base_script
{
    critter_script(const std::shared_ptr<critter>& c);
    ~critter_script() noexcept override;

    virtual void on_init(const std::shared_ptr<critter>& c) = 0;
    virtual void on_update(const std::shared_ptr<critter>& c, size_t& i, const Ns& dt) = 0;
    virtual void on_destroy(const std::shared_ptr<critter>& c, script_destroy_reason reason) = 0;
    virtual void delete_self() = 0;
    // todo can_activate, activate

    static critter_script* const empty_script;
};

} // namespace floormat