10 #include "basetypes.h" 47 #define CPI_DEFINE_BEHAVIOR(NAME) \ 48 class Behavior##NAME : public Behavior { \ 50 virtual MicroAction onPerform(Agent&) override; \ 54 #define CPI_DEFINE_INHERIT_BEHAVIOR(NAME, NAMEP) \ 55 class Behavior##NAME : public Behavior##NAMEP { \ 57 virtual MicroAction onPerform(Agent&) override; \ 60 CPI_DEFINE_BEHAVIOR(ML)
61 CPI_DEFINE_BEHAVIOR(Unstick)
62 CPI_DEFINE_BEHAVIOR(IfIrradiated)
63 CPI_DEFINE_BEHAVIOR(IfStormed)
64 CPI_DEFINE_BEHAVIOR(VsScarab)
65 CPI_DEFINE_BEHAVIOR(Formation)
66 CPI_DEFINE_BEHAVIOR(Detect)
67 CPI_DEFINE_BEHAVIOR(AsZergling)
68 CPI_DEFINE_BEHAVIOR(AsMutaliskVsScourge)
69 CPI_DEFINE_BEHAVIOR(AsMutaliskMicro)
70 CPI_DEFINE_BEHAVIOR(AsScourge)
71 CPI_DEFINE_BEHAVIOR(AsLurker)
72 CPI_DEFINE_BEHAVIOR(AsHydralisk)
73 CPI_DEFINE_BEHAVIOR(AsOverlord)
74 CPI_DEFINE_BEHAVIOR(AsDefilerConsumeOnly)
75 CPI_DEFINE_INHERIT_BEHAVIOR(AsDefiler, AsDefilerConsumeOnly)
76 CPI_DEFINE_BEHAVIOR(Chase)
77 CPI_DEFINE_BEHAVIOR(Kite)
78 CPI_DEFINE_BEHAVIOR(EngageCooperatively)
79 CPI_DEFINE_BEHAVIOR(Engage)
80 CPI_DEFINE_BEHAVIOR(Leave)
81 CPI_DEFINE_BEHAVIOR(Travel)
92 const BehaviorList behaviors_ = {};
const MicroAction pass
Convenience: A MicroAction reflecting a decision to ignore this unit and let another Behavior control...
Definition: behavior.h:35
A Behavior is a self-contained situational micro rule.
Definition: behavior.h:20
const MicroAction doNothing
Convenience: A MicroAction reflecting a decision to do nothing with this unit and let no other Behavi...
Definition: behavior.h:39
std::vector< std::shared_ptr< Behavior > > BehaviorList
Gives a series of Behaviors the option of issuing a UPC for the unit.
Definition: behavior.h:89
An Agent represents the micromanagement state of one of our units.
Definition: agent.h:31
virtual ~Behavior()=default
BehaviorSeries(BehaviorList behaviors)
Definition: behavior.h:96
Represents a decision of how to control a unit.
Definition: upc.h:135
virtual MicroAction onPerform(Agent &)=0
Decide what to do with a unit that has not yet been controlled by a Behavior.
Definition: behavior.h:90
MicroAction doAction(std::shared_ptr< UPCTuple > upc) const
Convenience method: Form a MicroAction reflecting a decision to issue a UPC for this unit...
Definition: behavior.h:30
Main namespace for bot-related code.
Definition: areainfo.cpp:17
void perform(Agent &agent)
Checks if a unit still needs a micro decision. If so, invokes onPerform()
Definition: behavior.cpp:17