Thunderbots Project
Loading...
Searching...
No Matches
eighteen_zone_pitch_division.h
1#pragma once
2#include <memory>
3
4#include "software/ai/passing/field_pitch_division.h"
5#include "software/geom/rectangle.h"
6#include "software/util/make_enum/make_enum.hpp"
7
8// clang-format off
9//
10// 18 Zone Pitch Division
11//
12// FRIENDLY ENEMY
13// ┌──────┬──────┬──────┬──────┬──────┬─────┐
14// │1 │4 │7 │10 │13 │16 │
15// │ │ │ │ │ │ │
16// │ │ │ │ │ │ │
17// ├──────┼──────┼──────┼──────┼──────┼─────┤
18// ┌─┤2 │5 │8 │11 │14 │17 ├─┐
19// │ │ │ │ │ │ │ │ │
20// │ │ │ │ │ │ │ │ │
21// └─┤ │ │ │ │ │ ├─┘
22// ├──────┼──────┼──────┼──────┼──────┼─────┤
23// │3 │6 │9 │12 │15 │18 │
24// │ │ │ │ │ │ │
25// │ │ │ │ │ │ │
26// └──────┴──────┴──────┴──────┴──────┴─────┘
27//
28MAKE_ENUM(EighteenZoneId,
29 ZONE_1, ZONE_2, ZONE_3, ZONE_4, ZONE_5,
30 ZONE_6, ZONE_7, ZONE_8, ZONE_9, ZONE_10,
31 ZONE_11, ZONE_12, ZONE_13, ZONE_14, ZONE_15,
32 ZONE_16, ZONE_17, ZONE_18);
33// clang-format on
34
35class EighteenZonePitchDivision : public FieldPitchDivision<EighteenZoneId>
36{
37 public:
43 EighteenZonePitchDivision(const Field& field);
44
45 const Rectangle& getZone(EighteenZoneId zone_id) const override;
46 const std::vector<EighteenZoneId>& getAllZoneIds() const override;
47 EighteenZoneId getZoneId(const Point& position) const override;
48
49 private:
50 std::shared_ptr<Rectangle> field_lines_;
51 std::vector<Rectangle> pitch_division_;
52 std::vector<EighteenZoneId> zones_;
53};
Definition eighteen_zone_pitch_division.h:36
EighteenZoneId getZoneId(const Point &position) const override
Definition eighteen_zone_pitch_division.cpp:33
const Rectangle & getZone(EighteenZoneId zone_id) const override
Definition eighteen_zone_pitch_division.cpp:28
const std::vector< EighteenZoneId > & getAllZoneIds() const override
Definition eighteen_zone_pitch_division.cpp:47
Definition field_pitch_division.h:13
Definition field.h:36
Definition point.h:14
Definition rectangle.h:10