// Project Lab - NHTV IGAD
//////////////////////////////////////////
// Author: Yoshi van Belkom - 130118
//////////////////////////////////////////
// A Hexagon Map with variable width and height.
//////////////////////////////////////////

#pragma once

#include "Engine/EngineTypes.h"
#include "HexMap.h"
#include "DynamicHexMap.generated.h"

USTRUCT()
struct FDynamicHexMap : public FHexMap
{
	GENERATED_BODY()
protected:
	//Returns true if x and y are valid positions on the hex map.
	virtual bool IsPointValid( int32 a_x, int32 a_y ) override
	{
		bool result = !( a_x < 0 || a_x >= width || a_y < 0 || a_y >= height );
		if ( result && IsOdd( a_x ) )
			result = ( a_y < ( 15 ) );
		return result;
	}
public:
	UPROPERTY( Category = Skill, EditAnywhere, meta = ( ClampMin = "1", ClampMax = "13", UIMin = "1", UIMax = "13" ) )
	int32 width = 13;
	UPROPERTY( Category = Skill, EditAnywhere, meta = ( ClampMin = "2", ClampMax = "16", UIMin = "2", UIMax = "16" ) )
	int32 height = 16;

	FDynamicHexMap()
	{}

	FDynamicHexMap( FDynamicHexMap& a_v )
	{
		for ( int i = 0; i < 13; i++ ) rawdata[i] = a_v.rawdata[i];
		width = a_v.width;
		height = a_v.height;
	}
};