Files
dt/CharacterMind.h
2026-11-03 20:05:02 -05:00

36 lines
965 B
C++

#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