 |
Grail (C++)
1.2.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
|
3 #ifndef GRAIL_DEBUGGER_H
4 #define GRAIL_DEBUGGER_H
6 #include "GrailStateSnapshotGenerator.h"
7 #include "IDebugSnapshotReceiver.h"
8 #include "ISnapshotGenerator.h"
9 #include "ITimestampProvider.h"
10 #include "../AIEntity.hh"
11 #include "../AIManager.hh"
15 #include <unordered_set>
23 GrailDebugger(
const std::shared_ptr<ITimestampProvider>& timestampProvider);
66 virtual void OnReasonerSet(
AIEntity& entity,
Reasoner* newReasoner)
override;
70 virtual void OnEntityRemoved(
const AIManager& manager,
size_t entityId)
override;
73 bool AttachToReasoner(
AIEntity& entity);
75 std::shared_ptr<ITimestampProvider> timestampProvider =
nullptr;
76 std::map<const AIManager*, std::vector<IDebugSnapshotReceiver*>> debugSnapshotReceivers{};
78 std::map<size_t, std::pair<std::unique_ptr<ISnapshotGenerator>, std::unordered_set<const AIManager*>>>
79 reasonerSnapshotGenerators{};
80 std::map<const AIManager*, std::unique_ptr<GrailStateSnapshotGenerator>> grailStateSnapshotGenerators{};
void AddDebugSnapshotReceiver(const AIManager *manager, IDebugSnapshotReceiver *receiver)
AddDebugSnapshotReceiver - registers a debug snapshot receiver that can react to newly produced debug...
Definition: GrailDebugger.cpp:103
The AIEntity class - Defines a basic object which can execute behaviors.
Definition: AIEntity.hh:50
The AIManager class - Manages registered entities and shared blackboards.
Definition: AIManager.hh:35
The Reasoner class - Entity's "brain", assigns them behaviors chosen by user-defined algorithms.
Definition: Reasoner.hh:21
void DetachFromEntity(AIEntity &entity)
DetachFromEntity - stops the production of debug data for an entity's reasoner.
Definition: GrailDebugger.cpp:92
void AttachToManager(AIManager *manager, bool attachToAllEntities=true)
AttachToManager - attaches the debugger instance to an AIManager.
Definition: GrailDebugger.cpp:13
Definition: AIEntity.hh:38
void Update()
Creates debug data for entities and managers that the debugger is attached to, notifies registered sn...
Definition: GrailDebugger.cpp:151
void AttachToEntity(AIEntity &entity)
AttachToEntity - starts producing debug data for an entity's reasoner.
Definition: GrailDebugger.cpp:84
Definition: AIManager.hh:18
Definition: GrailDebugger.h:20
Definition: IDebugSnapshotReceiver.h:16
void DetachFromManager(AIManager *manager)
DetachFromCurrentlyObservedManager - detaches the debugger from the currently selected AI Manager and...
Definition: GrailDebugger.cpp:52
void RemoveDebugSnapshotReceiver(const AIManager *manager, IDebugSnapshotReceiver *receiver)
AddDebugSnapshotReceiver - removes a debug snapshot receiver.
Definition: GrailDebugger.cpp:124