#include "QState.h"

QState::QState(){}

QState::QState(State s, int a){
	state = s;
	action = a;
}

State QState::getState(){
	return state;
}

int QState::getAction(){
	return action;
}

bool QState::operator==(const QState &qState) const {
	return (state == qState.state && action == qState.action);
}

std::ostream & operator<<(std::ostream &os, const QState &qState){
	return os << "|(" << qState.state << ") action: " << qState.action << "|";
}

size_t StateActionHash::operator()(const QState &qState) const {
	State s = qState.state;
	return std::hash<int>()(s.getHP()) ^ std::hash<int>()(s.getHPEnemies()) ^ std::hash<int>()(s.getAllies()) ^ std::hash<int>()(s.getEnemies()) ^ std::hash<int>()(s.getDistance()) ^ std::hash<int>()(s.getDPS()) ^ std::hash<int>()(s.getDPSEnemies()) ^ std::hash<int>()(s.getCoolDown()) ^ std::hash<int>()(s.getAttacked()) ^ std::hash<int>()(qState.action);
}