#pragma once #include "state.hpp" #include "player.hpp" #include "ship.hpp" #include "planet.hpp" #include "missile.hpp" #include namespace game { class Command { public: Command() { } virtual ~Command() { } virtual bool allowed(const Player *player, const State *state) const { (void) player; (void) state; return true; } virtual void apply(Player *player, State *state) const { (void) state; (void) player; std::cout<<"Command '" << name() << "' not yet implemented!" << std::endl; } virtual std::string name() const { return ""; } }; class ShootCommand : public Command { public: ShootCommand(float angle, float speed) : m_angle(angle), m_speed(speed) { } std::string name() const { return ""; } void apply( Player *player, State *state) const; bool allowed(const Player *player, const State *state) const; private: float m_angle; float m_speed; }; }