Select Git revision
FixedArray.hpp
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
FixedArray.hpp 1.01 KiB
#pragma once
#include <kernel/back/component/Physical.hpp>
#include <kernel/back/engine/PhysicEngine.hpp>
#include <vector>
#include <functional>
#include "Fixed.hpp"
namespace megu::kernel {
class FixedArray : public Physical<PhysicEngine>, public TangibleStatic {
public:
std::optional<std::reference_wrapper<const TangibleStatic>> at(const Position &) const;
void push(const Fixed &);
void erase(const Fixed &);
void erase(const Position &);
void setCollideLambda(CollideLambda);
void setUpdateLambda(UpdateLambda);
void update_physic(double) const override;
void on_collide(Kernel &, const PhysicEngine &, Physical &, double) override;
void apply(Kernel & k, PhysicEngine &) override;
void unapply(Kernel & k, PhysicEngine &) override;
private:
std::map<Position, Fixed> _tangibles;
CollideLambda _collide;
UpdateLambda _update;
};
}