this.GoalType = "HEALTHCAB";
this.Version = 1;
this.DefaultPriority = 0.75;
this.DisableIfEntityFlag(ENTFLAG.DISABLED);
this.CreateOnLoad = false;
this.RolePriorityBonus = 0.1;
this.Range = 1250.f;

//////////////////////////////////////////////////////////////////////////

this.InitNewGoal = function()
{
	this.CreateOnLoad = true; // user created goals need this
};

//////////////////////////////////////////////////////////////////////////

this.UpgradeVersion = function(Props)
{
	// version 0 is string,string key/values from the old waypoint format
	if(Props.Version==0)
	{
		// Version 1 Schema, upgrade from waypoint format
		Props.Version = 1;
	}
	else if(Props.Version == this.Version)
	{
		if ( Props.Range ) {
			this.Range = Props.Range;
		}
	}
};

//////////////////////////////////////////////////////////////////////////

this.Render = function()
{
	while(this.RenderGoal == true)
	{
		if(this.ExtraDebugText==null)
		{
			this.ExtraDebugText = "";
			//this.ExtraDebugText += format("Range: %g", ToFloat(this.Range));
		}

		this.RenderDefault();

		sleep(2);
	}
};

//////////////////////////////////////////////////////////////////////////

this.SaveToTable = function(SaveTable)
{
	// save the goal specific properties
	SaveTable.Range = this.Range;
};

//////////////////////////////////////////////////////////////////////////

this.Help = function()
{
	print(this.GoalType,"goal, version",this.Version);
	print("Optional:");
	print("		Range - default 1250, the radius in which the bot can use the cabinet");
};

//////////////////////////////////////////////////////////////////////////

this.SetProperty = function(property, value)
{
	switch(property)
	{
		case "range":
		{
			i = ToFloat(value);
			if ( typeId(i) == 2)
			{
				this.Range = i;
				print("Range set to " + i);
			}
			else
			{
				print(this.GoalType, ": Invalid value, expecting float");
			}
		}
		default:
		{
			print(this.GoalType, ": Invalid property:", property);
		}
	}

	this.ExtraDebugText = null;
};