Skip to content
Snippets Groups Projects
Player.hpp 987 B
Newer Older
  • Learn to ignore specific revisions
  • BATON Theau's avatar
    BATON Theau committed
    #pragma once
    
    #include <kernel/front/props/PropsPlayable.hpp>
    #include <game/back/GameObject.hpp>
    
    BATON Theau's avatar
    BATON Theau committed
    #include <game/back/object/Level.hpp>
    
    BATON Theau's avatar
    BATON Theau committed
    
    namespace megu::game {
    
    BATON Theau's avatar
    BATON Theau committed
        class Player : public kernel::PropsPlayable, public GameProps {
    
    BATON Theau's avatar
    BATON Theau committed
            public:
                Player(float x, float y, float w, float h, std::filesystem::path &);
    
                void move(float, float);
    
    
    BATON Theau's avatar
    BATON Theau committed
                void setup(kernel::Kernel &, Level &) override;
                void destroy(kernel::Kernel &, Level &) override;
    
    BATON Theau's avatar
    BATON Theau committed
    
                void apply(kernel::Kernel &) override;
    
    
    BATON Theau's avatar
    BATON Theau committed
                void on(const kernel::Prop &, const Event &) override;
                std::optional<Event> on() const override;
    
    BATON Theau's avatar
    BATON Theau committed
    
    
    BATON Theau's avatar
    BATON Theau committed
                void onDamage(const Event &);
    
    BATON Theau's avatar
    BATON Theau committed
                void onSolide(const kernel::Prop &); 
    
                kernel::Movable & getPhysic() {return this->_movable;}
                kernel::Sprite & getGraphic() {return this->_sprite;}
    
    BATON Theau's avatar
    BATON Theau committed
    
    
    BATON Theau's avatar
    BATON Theau committed
            private:
                kernel::Sprite _sprite;
                kernel::Movable _movable;
        };
    }