#pragma once
#include <BWAPI.h>
// #include "unordered_map_serialization.h"
#define BLOCKSIZE 64

class Block
{
private:
	BWAPI::Position topLeft;
	int size;
	double value;

	friend std::ostream& operator<<(std::ostream&, const Block&);
	//friend class boost::serialization::access;
	//friend class BlockHash;

	/*template<class Archive>
	void serialize(Archive & ar, const unsigned int version){

		ar & size;
		ar & value;
	}*/
public:
	Block();
	Block(int i, int j);
	Block(BWAPI::Position p);
	BWAPI::Position getTopLeft();
	BWAPI::Position getBottomRight();
	BWAPI::Position getCenter();
	double getValue();
	void setValue(double v);
	void addValue(double v);
	bool hasInside(BWAPI::Position p);
	bool operator==(const Block &block) const;
	bool operator<(const Block &block) const;
	void draw(bool isSolid = false);
	static int manhattanDistance(BWAPI::Position p1, BWAPI::Position p2);
};

/*class BlockHash
{
public:
	size_t operator()(const BlockHash &blockHash) const;
};*/