Thunderbots Project
Loading...
Searching...
No Matches
ai.h
1#pragma once
2
3#include <functional>
4
5#include "proto/play_info_msg.pb.h"
6#include "software/ai/hl/stp/play/play.h"
7#include "software/ai/play_selection_fsm.h"
8#include "software/time/timestamp.h"
9#include "software/world/world.h"
10
14class Ai final
15{
16 public:
17 Ai() = delete;
18
23 explicit Ai(const TbotsProto::AiConfig& ai_config);
24
30 void overridePlay(std::unique_ptr<Play> play);
31
41 std::unique_ptr<TbotsProto::PrimitiveSet> getPrimitives(const WorldPtr& world_ptr);
42
49 TbotsProto::PlayInfo getPlayInfo() const;
50
56 void overridePlayFromProto(TbotsProto::Play play_proto);
57
63 void updateAiConfig(TbotsProto::AiConfig& ai_config);
64
65 private:
66 void checkAiConfig();
67
68 TbotsProto::AiConfig ai_config_;
69 std::unique_ptr<FSM<PlaySelectionFSM>> fsm;
70 std::unique_ptr<Play> override_play;
71 std::unique_ptr<Play> current_play;
72 TbotsProto::Play current_override_play_proto;
73 bool ai_config_changed;
74
75 // inter play communication
76 InterPlayCommunication inter_play_communication;
77};
Definition ai.h:15
void overridePlay(std::unique_ptr< Play > play)
Definition ai.cpp:27
void updateAiConfig(TbotsProto::AiConfig &ai_config)
Definition ai.cpp:38
TbotsProto::PlayInfo getPlayInfo() const
Definition ai.cpp:99
void overridePlayFromProto(TbotsProto::Play play_proto)
Definition ai.cpp:32
std::unique_ptr< TbotsProto::PrimitiveSet > getPrimitives(const WorldPtr &world_ptr)
Definition ai.cpp:68
Definition play_fsm.h:15