#pragma once
#include <BWAPI.h>
#include "QAgent.h"

class AgentManager
{
	QTable qTable; // One QTable to rule them all!
	std::set<QAgent*> qAgents; // The list of agents to manage
	int totalReward;

public:
	AgentManager();

	QTable getQTable();
	std::set<QAgent*> getQAgents();

	void init(std::vector<double> w);
	void initAgents();
	void step(bool isFinalState, bool isWinner);
	void updateWeights(State state, int action, State nextState, double reward, bool terminalState);
	int getInstantRewardOnDefeat();
	int getTotalReward();
	void terminate(BWAPI::Unit u);
};

