BWAPI
quorum/ExampleAIModule/BidManager.h
Go to the documentation of this file.
00001 #ifndef BIDMANAGER_H
00002 #define BIDMANAGER_H
00003 #include "BWAPI.h"
00004 
00005 
00006 using namespace BWAPI;
00007 class AgentPool;
00008 class GoalDescriptor;
00009 
00010 struct reservation {
00011         int priority;
00012         int gas;
00013         int minerals;
00014         int lifetime;
00015         int goalDescriptor;
00016 };
00017 
00018 class BidManager {
00019 
00020 
00021 public:
00022         BidManager(AgentPool* p);
00023         void reserve(int minamount, int gasamount, int priority, int g);
00024         bool canWithdraw(int minamount, int gasamount, int priority);
00025         bool canCashIn(int minamount, int gasamount, int priority);
00026         void relinquish(int minamount, int gasamount, int priority, int g);
00027         int getReservedMinerals();
00028         int getReservedGas();
00029         void writeReservedMinerals();
00030         void updateDrives();
00031         AgentPool* agentPool;
00032 private:
00033         //AgentPool* agentPool;
00034         int numMinerals;
00035         int numGas;
00036         
00037         std::pair<int,int> reservedResources[64];
00038         std::vector<reservation> temporalData;
00039 
00040 
00041 
00042 };
00043 
00044 
00045 #endif
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines