base
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#ifndef CHARACTER_MIND_CLASS
|
||||
#define CHARACTER_MIND_CLASS
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "CharacterAction.h"
|
||||
|
||||
class Character;
|
||||
class Camera;
|
||||
|
||||
// Decides what a character does, as actions. A character without a mind does nothing.
|
||||
// AI goes here later, as another kind of mind.
|
||||
class CharacterMind {
|
||||
public:
|
||||
virtual ~CharacterMind() = default;
|
||||
|
||||
// Called once a frame, adds whatever the character should do this frame
|
||||
virtual void ProduceActions(const Character& character, std::vector<CharacterAction>& actions) = 0;
|
||||
};
|
||||
|
||||
// The player: WASD, relative to where the camera faces
|
||||
class KeyboardMind : public CharacterMind {
|
||||
public:
|
||||
explicit KeyboardMind(const Camera& camera) : camera(camera) {}
|
||||
|
||||
// Off while the keys are busy with something else, like typing in the console
|
||||
bool enabled = true;
|
||||
|
||||
void ProduceActions(const Character& character, std::vector<CharacterAction>& actions) override;
|
||||
|
||||
private:
|
||||
const Camera& camera;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user