Skip to content
Snippets Groups Projects
Select Git revision
  • 4c0d9457a42be976b86b15d29b45a994417612d8
  • main default protected
2 results

Vector.java

Blame
  • Forked from LABOUREL Arnaud / Vector 2023
    Source project has a limited visibility.
    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;
        };
    }