BWAPI
UAlbertaBot_src/Projects/UAlbertaBot/Source/ScoutManager.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include "Common.h"
00004 #include "micromanagement/MicroManager.h"
00005 #include "micromanagement/MicroUtil.h"
00006 
00007 class ScoutManager {
00008 
00009         BWAPI::Unit *   workerScout;
00010         int                             numWorkerScouts;
00011 
00012         bool                    distanceMapComputed;
00013         bool                    immediateThreat();
00014 
00015         BWAPI::Unit *   closestEnemyWorker();
00016 
00017         bool                    scoutUnderAttack;
00018         
00019         void smartMove(BWAPI::Unit * attacker, BWAPI::Position targetPosition);
00020         void smartAttack(BWAPI::Unit * attacker, BWAPI::Unit * target);
00021         bool enemyWorkerInRadius();
00022 
00023         BWAPI::Position         calcFleePosition(const std::vector<GroundThreat> & threats, BWAPI::Unit * target);
00024         bool                            isValidFleePosition(BWAPI::Position pos);
00025         void                            fillGroundThreats(std::vector<GroundThreat> & threats, BWAPI::Position target);
00026         double2                         getFleeVector(const std::vector<GroundThreat> & threats);
00027         BWAPI::Unit *           getEnemyGeyser();
00028 
00029 
00030 public:
00031 
00032         ScoutManager();
00033         ~ScoutManager() {};
00034 
00035         void update(const UnitVector & scoutUnits);
00036         void moveScouts();
00037 
00038         void onSendText(std::string text);
00039         void onUnitShow(BWAPI::Unit * unit);
00040         void onUnitHide(BWAPI::Unit * unit);
00041         void onUnitCreate(BWAPI::Unit * unit);
00042         void onUnitRenegade(BWAPI::Unit * unit);
00043         void onUnitDestroy(BWAPI::Unit * unit);
00044         void onUnitMorph(BWAPI::Unit * unit);
00045 };
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines