|
Grail (C++)
1.4.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>
25 std::unique_ptr<GrailDebugger> debugger;
26 std::unique_ptr<class DebugInfoGenerator> debugInfoGenerator;
29 GrailDebugger(
const std::shared_ptr<ITimestampProvider>& timestampProvider);
37 const std::shared_ptr<ITimestampProvider>& timestampProvider);
78 virtual void OnReasonerSet(
AIEntity& entity,
Reasoner* newReasoner)
override;
82 virtual void OnEntityRemoved(
const AIManager& manager,
size_t entityId)
override;
86 bool AttachToReasoner(
AIEntity& entity,
bool verifyEntityRegistered);
88 std::shared_ptr<ITimestampProvider> timestampProvider =
nullptr;
89 std::map<const AIManager*, std::vector<IDebugSnapshotReceiver*>> debugSnapshotReceivers{};
91 std::map<size_t, std::pair<std::unique_ptr<ISnapshotGenerator>, std::unordered_set<const AIManager*>>>
92 reasonerSnapshotGenerators{};
93 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:111
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:32
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:100
void AttachToManager(AIManager *manager, bool attachToAllEntities=true)
AttachToManager - attaches the debugger instance to an AIManager.
Definition: GrailDebugger.cpp:24
Definition: AIEntity.hh:38
void AttachToEntity(AIEntity &entity)
AttachToEntity - starts producing debug data for an entity's reasoner.
Definition: GrailDebugger.cpp:95
Definition: AIManager.hh:15
Definition: GrailDebugger.h:20
Definition: IDebugSnapshotReceiver.h:16
static DebuggerData CreateDefaultFor(const AIManager &aiManager, const std::shared_ptr< ITimestampProvider > ×tampProvider)
Creates a new GrailDebugger for a specific AIManager.
Definition: GrailDebugger.cpp:15
void Update() const
Creates debug data for entities and managers that the debugger is attached to, notifies registered sn...
Definition: GrailDebugger.cpp:159
void DetachFromManager(AIManager *manager)
DetachFromCurrentlyObservedManager - detaches the debugger from the currently selected AI Manager and...
Definition: GrailDebugger.cpp:63
Definition: GrailDebugger.h:23
void RemoveDebugSnapshotReceiver(const AIManager *manager, IDebugSnapshotReceiver *receiver)
AddDebugSnapshotReceiver - removes a debug snapshot receiver.
Definition: GrailDebugger.cpp:132