Thunderbots Project
Loading...
Searching...
No Matches
attacker_tactic.h
1#pragma once
2
3#include "software/ai/hl/stp/tactic/attacker/attacker_fsm.h"
4#include "software/ai/hl/stp/tactic/tactic.h"
5#include "software/ai/passing/pass.h"
6
14class AttackerTactic : public Tactic
15{
16 public:
22 explicit AttackerTactic(TbotsProto::AiConfig ai_config);
23
24 AttackerTactic() = delete;
25
31 void updateControlParams(const Pass& best_pass_so_far, bool pass_committed);
32
40 void updateControlParams(std::optional<Point> chip_target);
41
42 void accept(TacticVisitor& visitor) const override;
43
44 DEFINE_TACTIC_DONE_AND_GET_FSM_STATE
45
46 private:
47 void updatePrimitive(const TacticUpdate& tactic_update, bool reset_fsm) override;
48
55 void visualizeControlParams(const World& world,
56 const AttackerFSM::ControlParams& control_params);
57
58 std::map<RobotId, std::unique_ptr<FSM<AttackerFSM>>> fsm_map;
59
60 // The pass to execute
61 std::optional<Pass> best_pass_so_far;
62 // whether we have committed to the above pass
63 bool pass_committed;
64 // The point the robot will chip towards if it is unable to shoot and is in danger
65 // of losing the ball to an enemy
66 std::optional<Point> chip_target;
67
68 // AI config
69 TbotsProto::AiConfig ai_config;
70};
Definition attacker_tactic.h:15
void accept(TacticVisitor &visitor) const override
Definition attacker_tactic.cpp:37
void updateControlParams(const Pass &best_pass_so_far, bool pass_committed)
Definition attacker_tactic.cpp:24
Definition pass.h:20
Definition tactic_visitor.h:39
Definition tactic.h:39
Definition world.h:23
Definition attacker_fsm.h:21
Definition tactic_fsm.h:16