Grail (C++)  1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
LiveDebuggerServerYaml.h
1 #ifndef GRAIL_LIVE_DEBUGGER_SERVER_YAML_H
2 #define GRAIL_LIVE_DEBUGGER_SERVER_YAML_H
3 
4 #include "LiveDebuggerServer.h"
5 
6 namespace grail
7 {
8 namespace live
9 {
11  {
12  public:
13  LiveDebuggerServerYaml(const std::string& serverName);
14 
15  virtual void ProcessSnapshot(data::GrailStateSnapshot& stateSnapshot) override;
16  virtual void ProcessSnapshot(data::UtilityReasonerSnapshot& utilitySnapshot) override;
17  virtual void ProcessSnapshot(data::PlannerReasonerSnapshot& plannerSnapshot) override;
18  virtual void ProcessSnapshot(data::SimulatedGameReasonerSnapshot& simulatedGamesSnapshot) override;
19 
20  private:
21  template <typename SnapshotType>
22  void SendSnapshots(SnapshotType snapshot)
23  {
24  if(tcpServer.IsAnyConnected())
25  {
26  std::string serializedSnapshot = c4::yml::writeToString(snapshot);
27  tcpServer.SendToAll(serializedSnapshot);
28  }
29  }
30  };
31 }
32 }
33 
34 #endif // GRAIL_LIVE_DEBUGGER_SERVER_YAML_H
grail::data::UtilityReasonerSnapshot
Definition: UtilityReasonerSnapshot.h:15
grail::data::SimulatedGameReasonerSnapshot
Definition: SimulatedGamesSnapshots.h:129
grail::data::PlannerReasonerSnapshot
Definition: PlannerSnapshots.h:92
grail::data::GrailStateSnapshot
Definition: GrailStateSnapshot.h:18
grail::live::LiveDebuggerServerYaml
Definition: LiveDebuggerServerYaml.h:10
grail::live::LiveDebuggerServer
Definition: LiveDebuggerServer.h:16