BWAPI
SPAR/AIModule/SparAIModule/DecisionMaking/Layer2Actions/Interface/Actions/Defend.h
Go to the documentation of this file.
00001 #pragma once
00002 #include "GroupTacticalAction.h"
00003 
00004 // TODO: possibly more than two locations so units can patrol?
00005 
00006 namespace layer2
00007 {
00008   class Defend : public virtual GroupTacticalAction
00009   {
00010   public:
00011     Defend(unsigned int priority, const PersistentUnitGroup* initialGroup, Location* location)
00012       : GroupTacticalAction(priority, initialGroup)
00013       , TacticalAction(priority)
00014       , Process(Spar)
00015       , m_location(location)
00016     {
00017     }
00018 
00019     virtual std::string getName() const
00020     {
00021       return "Defend";
00022     }
00023 
00024   protected:
00025     virtual void output(std::ostream& out) const
00026     {
00027       GroupTacticalAction::output(out);
00028 
00029       out << "Defend(" << getGroup()->getName() << ", " << *m_location << ")";
00030     }
00031 
00032     Location* const m_location;
00033   };
00034 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines