include "vehicle.gs"
include "MeshObject.gs"

////////////////////////////////////////////////////////////////////////////////////////
// SSVehicle class - use for any non motorised traincar
////////////////////////////////////////////////////////////////////////////////////////

class SSVehicle isclass Vehicle {

	Library A;
	GSObject[] Objects;
	string[] Strings;
	Soup SSSoup;
	bool derailed = false;
	Browser ViewDetailsBrowser;
	int  vdb_left = 100;
	int  vdb_right = 340;
	int  vdb_top = 100;
	int  vdb_bottom = 345;

	thread void Monitor() {
		SSSoup.SetNamedTag("VehicleID", me.GetId());
		while (!derailed and Router.GetGameObject(SSSoup.GetNamedTagAsInt("VehicleID"))) {
			A.LibraryCall("Update",null,Objects);
			Sleep(SSSoup.GetNamedTagAsFloat("sleeptime"));
		}
	}

	public void Init(void) {
		inherited();
		SSSoup = Constructors.NewSoup();
		Objects = new GSObject[3];
		Objects[0] = me;
		Objects[1] = SSSoup;
		Strings = new string[4];
		Soup extensions = GetAsset().GetConfigSoup().GetNamedSoup("extensions");
		A = World.GetLibrary(me.GetAsset().LookupKUIDTable("codelib"));
		if (!A) {Exception("Unable to load Code Library <kuid:122285:508>\n\n\n\n\n\n\n\n\n");}		
		A.LibraryCall("AddHandlers",Strings,Objects);		
		if (A.LibraryCall("Monitor",null,Objects) == "Run") Monitor();
		PostMessage(me,"SS-122285","Setup",0.0);
	}

	void MessageHandler(Message msg) {
		Objects[2] = msg.src;
		Strings[0] = msg.major;
		Strings[1] = msg.minor;
		A.LibraryCall("Message",Strings,Objects);
		derailed = (msg.major == "Vehicle" and msg.minor == "Derailed" and msg.src == me);
	}

	void BrowserCloseHandler(Message msg) {
		if (msg.src == ViewDetailsBrowser) {ViewDetailsBrowser = null;}
	}

	void BrowserUrlHandler(Message msg) {
		if (msg.src == ViewDetailsBrowser) {
			Objects[2] = msg.src;
			Strings[0] = msg.major;
			Strings[1] = msg.minor;
			A.LibraryCall("Message",Strings,Objects);
			ViewDetails(msg);
		}
	}

	public void ViewDetails(Message msg) {
		if (ViewDetailsBrowser) {
			vdb_left   = ViewDetailsBrowser.GetWindowLeft();
			vdb_top    = ViewDetailsBrowser.GetWindowTop();
			vdb_right  = ViewDetailsBrowser.GetWindowRight();
			vdb_bottom = ViewDetailsBrowser.GetWindowBottom();
		} else {
			ViewDetailsBrowser = Constructors.NewBrowser();
		}
		ViewDetailsBrowser.SetWindowRect(vdb_left, vdb_top, vdb_right, vdb_bottom);
		Objects[2] = strTable;
		ViewDetailsBrowser.LoadHTMLString(A.LibraryCall("ViewDetails",Strings,Objects));
	}

	public void SetProperties(Soup soup) {
		inherited(soup);
		SSSoup.SetNamedTag("bogiemesh",soup.GetNamedTagAsInt("bogiemesh",-1));
		SSSoup.SetNamedTag("submesh",soup.GetNamedTagAsInt("submesh",-2));
		SSSoup.SetNamedTag("operator",soup.GetNamedTagAsInt("operator",0));
		SSSoup.SetNamedTag("weathered",soup.GetNamedTagAsBool("weathered",false));
		SSSoup.SetNamedTag("position",soup.GetNamedTagAsInt("position",-1));
		SSSoup.SetNamedTag("corridor-0",soup.GetNamedTagAsInt("corridor-0",-2));
		SSSoup.SetNamedTag("corridor-1",soup.GetNamedTagAsInt("corridor-1",-2));
		SSSoup.SetNamedTag("destination",soup.GetNamedTagAsInt("destination",-2));
		SSSoup.SetNamedTag("advert",soup.GetNamedTagAsInt("advert",-1));
		SSSoup.SetNamedTag("speed",0.0);
		SSSoup.SetNamedTag("indicating",false);		
		SSSoup.SetNamedTag("routeindex",soup.GetNamedTagAsInt("routeindex",0));
		SSSoup.SetNamedTag("isoutbound",soup.GetNamedTagAsBool("isoutbound",true));
		SSSoup.SetNamedTag("route",soup.GetNamedTag("route"));
		SSSoup.SetNamedTag("number",soup.GetNamedTag("number"));
		SSSoup.SetNamedTag("start",soup.GetNamedTag("start"));
		SSSoup.SetNamedTag("via",soup.GetNamedTag("via"));		
		SSSoup.SetNamedTag("finish",soup.GetNamedTag("finish"));
		SSSoup.SetNamedTag("startmark",soup.GetNamedTag("startmark"));
		SSSoup.SetNamedTag("endmark",soup.GetNamedTag("endmark"));		
		A.LibraryCall("Refresh",null,Objects);
	}

	public Soup GetProperties(void) {
		Soup soup = inherited();
		soup.SetNamedTag("bogiemesh",SSSoup.GetNamedTagAsInt("bogiemesh"));
		soup.SetNamedTag("submesh",SSSoup.GetNamedTagAsInt("submesh"));
		soup.SetNamedTag("operator",SSSoup.GetNamedTagAsInt("operator"));
		soup.SetNamedTag("weathered",SSSoup.GetNamedTagAsBool("weathered"));
		soup.SetNamedTag("position",SSSoup.GetNamedTagAsInt("position"));
		soup.SetNamedTag("corridor-0",SSSoup.GetNamedTagAsInt("corridor-0"));
		soup.SetNamedTag("corridor-1",SSSoup.GetNamedTagAsInt("corridor-1"));
		soup.SetNamedTag("destination",SSSoup.GetNamedTagAsInt("destination"));
		soup.SetNamedTag("advert",SSSoup.GetNamedTagAsInt("advert"));
		soup.SetNamedTag("routeindex",SSSoup.GetNamedTagAsInt("routeindex",0));
		soup.SetNamedTag("isoutbound",SSSoup.GetNamedTagAsBool("isoutbound",true));
		soup.SetNamedTag("route",SSSoup.GetNamedTag("route"));
		soup.SetNamedTag("number",SSSoup.GetNamedTag("number"));
		soup.SetNamedTag("start",SSSoup.GetNamedTag("start"));
		soup.SetNamedTag("via",SSSoup.GetNamedTag("via"));
		soup.SetNamedTag("finish",SSSoup.GetNamedTag("finish"));
		soup.SetNamedTag("startmark",SSSoup.GetNamedTag("startmark"));
		soup.SetNamedTag("endmark",SSSoup.GetNamedTag("endmark"));		
		return soup;
	}

	public string GetDescriptionHTML(void) {
		Strings[0] = inherited();
		return A.LibraryCall("GetDescriptionHTML",Strings,Objects);
	}
	
	public string GetPropertyName(string pID) {
		Strings[0] = inherited(pID);
		Strings[1] = pID;
		return A.LibraryCall("GetPropertyName",Strings,Objects);
	}

	string GetPropertyType(string pID) {
		Strings[0] = inherited(pID);
		Strings[1] = pID;
		return A.LibraryCall("GetPropertyType",Strings,Objects);
	}
	
	public string GetPropertyValue(string pID) {
		Strings[0] = inherited(pID);
		Strings[1] = pID;
		return A.LibraryCall("GetPropertyValue",Strings,Objects);
	}

	void LinkPropertyValue(string pID) {
		Strings[0] = pID;
		if (A.LibraryCall("LinkPropertyValue",Strings,Objects) == "0") {
			inherited(pID);
		}
	}

	public void SetPropertyValue(string pID, string value) {
		Strings[0] = pID;
		Strings[1] = value;
		if (A.LibraryCall("SetPropertyString",Strings,Objects) == "0") {
			inherited(pID,value);
		}
	}

	public void SetPropertyValue(string pID, string value, int index) {
		Strings[0] = pID;
		Strings[1] = value;
		Strings[2] = index;
		if (A.LibraryCall("SetPropertyValue",Strings,Objects) == "0") {
			inherited(pID,value,index);
		}
	}

	public string[] GetPropertyElementList(string pID) {
		Strings[0] = pID;
		if (A.LibraryCall("GetPropertyElementList",Strings,Objects) == "0") {
			return inherited(pID);
		}
		return Strings;
	}

};

////////////////////////////////////////////////////////////////////////////////////////
// SSLoco class - use for any motorised traincar
////////////////////////////////////////////////////////////////////////////////////////

class SSLoco isclass Locomotive {

	Library A;
	GSObject[] Objects;
	string[] Strings;
	Soup SSSoup;
	bool derailed = false;
	Browser ViewDetailsBrowser;
	int  vdb_left = 100;
	int  vdb_right = 340;
	int  vdb_top = 100;
	int  vdb_bottom = 345;

	thread void Monitor() {
		SSSoup.SetNamedTag("VehicleID", me.GetId());
		while (!derailed and Router.GetGameObject(SSSoup.GetNamedTagAsInt("VehicleID"))) {
			A.LibraryCall("Update",null,Objects);
			Sleep(SSSoup.GetNamedTagAsFloat("sleeptime"));
		}
	}

	public void Init(void) {
		inherited();
		SSSoup = Constructors.NewSoup();
		Objects = new GSObject[3];
		Objects[0] = me;
		Objects[1] = SSSoup;
		Strings = new string[4];
		A = World.GetLibrary(me.GetAsset().LookupKUIDTable("codelib"));
		if (!A) {Exception("Unable to load Code Library <kuid:122285:508>\n\n\n\n\n\n\n\n\n");}
		A.LibraryCall("AddHandlers",Strings,Objects);
		if (A.LibraryCall("Monitor",null,Objects) == "Run") Monitor();
		PostMessage(me,"SS-122285","Setup",0.0);
	}

	void MessageHandler(Message msg) {
		Objects[2] = msg.src;
		Strings[0] = msg.major;
		Strings[1] = msg.minor;
		A.LibraryCall("Message",Strings,Objects);
		derailed = (msg.major == "Vehicle" and msg.minor == "Derailed" and msg.src == me);
	}

	void BrowserCloseHandler(Message msg) {
		if (msg.src == ViewDetailsBrowser) {ViewDetailsBrowser = null;}
	}

	void BrowserUrlHandler(Message msg) {
		if (msg.src == ViewDetailsBrowser) {
			Objects[2] = msg.src;
			Strings[0] = msg.major;
			Strings[1] = msg.minor;
			A.LibraryCall("Message",Strings,Objects);
			ViewDetails(msg);
		}
	}

	public void ViewDetails(Message msg) {
		if (ViewDetailsBrowser) {
			vdb_left   = ViewDetailsBrowser.GetWindowLeft();
			vdb_top    = ViewDetailsBrowser.GetWindowTop();
			vdb_right  = ViewDetailsBrowser.GetWindowRight();
			vdb_bottom = ViewDetailsBrowser.GetWindowBottom();
		} else {
			ViewDetailsBrowser = Constructors.NewBrowser();
		}
		ViewDetailsBrowser.SetWindowRect(vdb_left, vdb_top, vdb_right, vdb_bottom);
		Objects[2] = strTable;
		ViewDetailsBrowser.LoadHTMLString(A.LibraryCall("ViewDetails",Strings,Objects));
	}

	public void SetProperties(Soup soup) {
		inherited(soup);
		SSSoup.SetNamedTag("bogiemesh",soup.GetNamedTagAsInt("bogiemesh",-1));
		SSSoup.SetNamedTag("submesh",soup.GetNamedTagAsInt("submesh",-2));
		SSSoup.SetNamedTag("operator",soup.GetNamedTagAsInt("operator",0));
		SSSoup.SetNamedTag("weathered",soup.GetNamedTagAsBool("weathered",false));
		SSSoup.SetNamedTag("position",soup.GetNamedTagAsInt("position",-1));
		SSSoup.SetNamedTag("corridor-0",soup.GetNamedTagAsInt("corridor-0",-2));
		SSSoup.SetNamedTag("corridor-1",soup.GetNamedTagAsInt("corridor-1",-2));
		SSSoup.SetNamedTag("destination",soup.GetNamedTagAsInt("destination",-2));
		SSSoup.SetNamedTag("advert",soup.GetNamedTagAsInt("advert",-1));
		SSSoup.SetNamedTag("speed",0.0);
		SSSoup.SetNamedTag("indicating",false);
		SSSoup.SetNamedTag("routeindex",soup.GetNamedTagAsInt("routeindex",0));
		SSSoup.SetNamedTag("isoutbound",soup.GetNamedTagAsBool("isoutbound",true));
		SSSoup.SetNamedTag("route",soup.GetNamedTag("route"));
		SSSoup.SetNamedTag("number",soup.GetNamedTag("number"));
		SSSoup.SetNamedTag("start",soup.GetNamedTag("start"));
		SSSoup.SetNamedTag("via",soup.GetNamedTag("via"));		
		SSSoup.SetNamedTag("finish",soup.GetNamedTag("finish"));
		SSSoup.SetNamedTag("startmark",soup.GetNamedTag("startmark"));
		SSSoup.SetNamedTag("endmark",soup.GetNamedTag("endmark"));		
		A.LibraryCall("Refresh",null,Objects);
	}

	public Soup GetProperties(void) {
		Soup soup = inherited();
		soup.SetNamedTag("bogiemesh",SSSoup.GetNamedTagAsInt("bogiemesh"));
		soup.SetNamedTag("submesh",SSSoup.GetNamedTagAsInt("submesh"));
		soup.SetNamedTag("operator",SSSoup.GetNamedTagAsInt("operator"));
		soup.SetNamedTag("weathered",SSSoup.GetNamedTagAsBool("weathered"));
		soup.SetNamedTag("position",SSSoup.GetNamedTagAsInt("position"));
		soup.SetNamedTag("corridor-0",SSSoup.GetNamedTagAsInt("corridor-0"));
		soup.SetNamedTag("corridor-1",SSSoup.GetNamedTagAsInt("corridor-1"));
		soup.SetNamedTag("destination",SSSoup.GetNamedTagAsInt("destination"));
		soup.SetNamedTag("advert",SSSoup.GetNamedTagAsInt("advert"));
		soup.SetNamedTag("routeindex",SSSoup.GetNamedTagAsInt("routeindex",0));
		soup.SetNamedTag("isoutbound",SSSoup.GetNamedTagAsBool("isoutbound",true));
		soup.SetNamedTag("route",SSSoup.GetNamedTag("route"));
		soup.SetNamedTag("number",SSSoup.GetNamedTag("number"));
		soup.SetNamedTag("start",SSSoup.GetNamedTag("start"));
		soup.SetNamedTag("via",SSSoup.GetNamedTag("via"));
		soup.SetNamedTag("finish",SSSoup.GetNamedTag("finish"));
		soup.SetNamedTag("startmark",SSSoup.GetNamedTag("startmark"));
		soup.SetNamedTag("endmark",SSSoup.GetNamedTag("endmark"));		
		return soup;
	}

	public string GetDescriptionHTML(void) {
		Strings[0] = inherited();
		return A.LibraryCall("GetDescriptionHTML",Strings,Objects);
	}
	
	public string GetPropertyName(string pID) {
		Strings[0] = inherited(pID);
		Strings[1] = pID;
		return A.LibraryCall("GetPropertyName",Strings,Objects);
	}

	public string GetPropertyValue(string pID) {
		Strings[0] = inherited(pID);
		Strings[1] = pID;
		return A.LibraryCall("GetPropertyValue",Strings,Objects);
	}

	string GetPropertyType(string pID) {
		Strings[0] = inherited(pID);
		Strings[1] = pID;
		return A.LibraryCall("GetPropertyType",Strings,Objects);
	}

	void LinkPropertyValue(string pID) {
		Strings[0] = pID;
		if (A.LibraryCall("LinkPropertyValue",Strings,Objects) == "0") {
			inherited(pID);
		}
	}

	public void SetPropertyValue(string pID, string value) {
		Strings[0] = pID;
		Strings[1] = value;
		if (A.LibraryCall("SetPropertyString",Strings,Objects) == "0") {
			inherited(pID,value);
		}
	}

	public void SetPropertyValue(string pID, string value, int index) {
		Strings[0] = pID;
		Strings[1] = value;
		Strings[2] = index;
		if (A.LibraryCall("SetPropertyValue",Strings,Objects) == "0") {
			inherited(pID,value,index);
		}
	}

	public string[] GetPropertyElementList(string pID) {
		Strings[0] = pID;
		if (A.LibraryCall("GetPropertyElementList",Strings,Objects) == "0") {
			return inherited(pID);
		}
		return Strings;
	}

};

////////////////////////////////////////////////////////////////////////////////////////
// SSBogie class - use for any scripted bogie asset
////////////////////////////////////////////////////////////////////////////////////////

class SSBogie isclass MeshObject {

	Library A;
	GSObject[] Objects;
	string[] Strings;

	public void Init(void) {
		inherited();
		Objects = new GSObject[2];
		Objects[0] = me;
		Strings = new string[2];
		AddHandler(me,"SS-122285","","MessageHandler");
		A = World.GetLibrary(me.GetAsset().LookupKUIDTable("codelib"));
		if (!A) {Exception(
			"Unable to load Code Library <kuid:122285:508>\n"
		+	"This almost always means that this asset is not\n"
		+	"installed on your system or is corrupt!\n\n\n\n\n\n\n\n"
		);}
		A.LibraryCall("Monitor",null,Objects);
	}

	void MessageHandler(Message msg) {
		Objects[1] = msg.src;
		Strings[0] = msg.major;
		Strings[1] = msg.minor;
		A.LibraryCall("Message",Strings,Objects);
	}

};


////////////////////////////////////////////////////////////////////////////////////////
// SSTrackmark Class
////////////////////////////////////////////////////////////////////////////////////////

class SSTrackmark isclass TrackMark {

/*Library A;
	GSObject[] Objects;
	string[] Strings;
	Soup SSSoup;*/

	public void Init(void) {
		inherited();
	}
/*	SSSoup = Constructors.NewSoup();
		Objects = new GSObject[3];
		Objects[0] = me;
		Objects[1] = SSSoup;
		Strings = new string[4];
		Sniff(me.GetMyTrain(),"TrackMark","",true);		
		AddHandler(me,"Vehicle","","MessageHandler");
		AddHandler(me,"World","","MessageHandler");
		AddHandler(me,"Train","","MessageHandler");
		AddHandler(me,"SS-122285","","MessageHandler");
		AddHandler(me,"MapObject","","MessageHandler");
		AddHandler(me,"TrackMark","","MessageHandler");		
		AddHandler(me,"ChangeDestinationSign","","MessageHandler");
		AddHandler(me,"Animation-Event","","MessageHandler");		
		AddHandler(me,"Browser-Closed","","BrowserCloseHandler");
		AddHandler(me,"Browser-URL","","BrowserUrlHandler");
		Soup extensions = GetAsset().GetConfigSoup().GetNamedSoup("extensions");
		A = World.GetLibrary(me.GetAsset().LookupKUIDTable("codelib"));
		if (!A) {Exception("Unable to load Code Library <kuid:122285:508>\n\n\n\n\n\n\n\n\n");}
		A.LibraryCall("AddHandlers",Strings,Objects);
		if (A.LibraryCall("Monitor",null,Objects) == "Run") Monitor();
		PostMessage(me,"SS-122285","Setup",0.0);
*/		

/*void MessageHandler(Message msg) {
		Objects[2] = msg.src;
		Strings[0] = msg.major;
		Strings[1] = msg.minor;
		A.LibraryCall("Message",Strings,Objects);
		derailed = (msg.major == "Vehicle" and msg.minor == "Derailed" and msg.src == me);
	}*/

/*void BrowserCloseHandler(Message msg) {
		if (msg.src == ViewDetailsBrowser) {ViewDetailsBrowser = null;}
	}

	void BrowserUrlHandler(Message msg) {
		if (msg.src == ViewDetailsBrowser) {
			Objects[2] = msg.src;
			Strings[0] = msg.major;
			Strings[1] = msg.minor;
			A.LibraryCall("Message",Strings,Objects);
			ViewDetails(msg);
		}
	}

	public void ViewDetails(Message msg) {
		if (ViewDetailsBrowser) {
			vdb_left   = ViewDetailsBrowser.GetWindowLeft();
			vdb_top    = ViewDetailsBrowser.GetWindowTop();
			vdb_right  = ViewDetailsBrowser.GetWindowRight();
			vdb_bottom = ViewDetailsBrowser.GetWindowBottom();
		} else {
			ViewDetailsBrowser = Constructors.NewBrowser();
		}
		ViewDetailsBrowser.SetWindowRect(vdb_left, vdb_top, vdb_right, vdb_bottom);
		Objects[2] = strTable;
		ViewDetailsBrowser.LoadHTMLString(A.LibraryCall("ViewDetails",Strings,Objects));
	}*/

/*public void SetProperties(Soup soup) {
		inherited(soup);
		SSSoup.SetNamedTag("bogiemesh",soup.GetNamedTagAsInt("bogiemesh",-1));
		SSSoup.SetNamedTag("submesh",soup.GetNamedTagAsInt("submesh",-2));
		SSSoup.SetNamedTag("operator",soup.GetNamedTagAsInt("operator",0));
		SSSoup.SetNamedTag("weathered",soup.GetNamedTagAsBool("weathered",false));
		SSSoup.SetNamedTag("position",soup.GetNamedTagAsInt("position",-1));
		SSSoup.SetNamedTag("corridor-0",soup.GetNamedTagAsInt("corridor-0",-2));
		SSSoup.SetNamedTag("corridor-1",soup.GetNamedTagAsInt("corridor-1",-2));
		SSSoup.SetNamedTag("destination",soup.GetNamedTagAsInt("destination",-2));
		SSSoup.SetNamedTag("advert",soup.GetNamedTagAsInt("advert",-1));
		SSSoup.SetNamedTag("speed",0.0);
		SSSoup.SetNamedTag("indicating",false);
		SSSoup.SetNamedTag("routeindex",soup.GetNamedTagAsInt("routeindex",0));
		SSSoup.SetNamedTag("isoutbound",soup.GetNamedTagAsBool("isoutbound",true));
		SSSoup.SetNamedTag("route",soup.GetNamedTag("route"));
		SSSoup.SetNamedTag("number",soup.GetNamedTag("number"));
		SSSoup.SetNamedTag("start",soup.GetNamedTag("start"));
		SSSoup.SetNamedTag("finish",soup.GetNamedTag("finish"));
		SSSoup.SetNamedTag("mark1",soup.GetNamedTag("mark1"));
		SSSoup.SetNamedTag("mark2",soup.GetNamedTag("mark2"));
		A.LibraryCall("Refresh",null,Objects);
	}*/

/*public Soup GetProperties(void) {
		Soup soup = inherited();
		soup.SetNamedTag("bogiemesh",SSSoup.GetNamedTagAsInt("bogiemesh"));
		soup.SetNamedTag("submesh",SSSoup.GetNamedTagAsInt("submesh"));
		soup.SetNamedTag("operator",SSSoup.GetNamedTagAsInt("operator"));
		soup.SetNamedTag("weathered",SSSoup.GetNamedTagAsBool("weathered"));
		soup.SetNamedTag("position",SSSoup.GetNamedTagAsInt("position"));
		soup.SetNamedTag("corridor-0",SSSoup.GetNamedTagAsInt("corridor-0"));
		soup.SetNamedTag("corridor-1",SSSoup.GetNamedTagAsInt("corridor-1"));
		soup.SetNamedTag("destination",SSSoup.GetNamedTagAsInt("destination"));
		soup.SetNamedTag("advert",SSSoup.GetNamedTagAsInt("advert"));
		soup.SetNamedTag("routeindex",SSSoup.GetNamedTagAsInt("routeindex",0));
		soup.SetNamedTag("isoutbound",SSSoup.GetNamedTagAsBool("isoutbound",true));
		soup.SetNamedTag("route",SSSoup.GetNamedTag("route"));
		soup.SetNamedTag("number",SSSoup.GetNamedTag("number"));
		soup.SetNamedTag("start",SSSoup.GetNamedTag("start"));
		soup.SetNamedTag("finish",SSSoup.GetNamedTag("finish"));
		soup.SetNamedTag("mark1",SSSoup.GetNamedTag("mark1"));
		soup.SetNamedTag("mark2",SSSoup.GetNamedTag("mark2"));
		return soup;
	}*/

/*public string GetDescriptionHTML(void) {
		Strings[0] = inherited();
		return A.LibraryCall("GetDescriptionHTML",Strings,Objects);
	}
	
	public string GetPropertyName(string pID) {
		Strings[0] = inherited(pID);
		Strings[1] = pID;
		return A.LibraryCall("GetPropertyName",Strings,Objects);
	}

	public string GetPropertyValue(string pID) {
		Strings[0] = inherited(pID);
		Strings[1] = pID;
		return A.LibraryCall("GetPropertyValue",Strings,Objects);
	}

	string GetPropertyType(string pID) {
		Strings[0] = inherited(pID);
		Strings[1] = pID;
		return A.LibraryCall("GetPropertyType",Strings,Objects);
	}

	void LinkPropertyValue(string pID) {
		Strings[0] = pID;
		if (A.LibraryCall("LinkPropertyValue",Strings,Objects) == "0") {
			inherited(pID);
		}
	}

	public void SetPropertyValue(string pID, string value) {
		Strings[0] = pID;
		Strings[1] = value;
		if (A.LibraryCall("SetPropertyString",Strings,Objects) == "0") {
			inherited(pID,value);
		}
	}

	public void SetPropertyValue(string pID, string value, int index) {
		Strings[0] = pID;
		Strings[1] = value;
		Strings[2] = index;
		if (A.LibraryCall("SetPropertyValue",Strings,Objects) == "0") {
			inherited(pID,value,index);
		}
	}

	public string[] GetPropertyElementList(string pID) {
		Strings[0] = pID;
		if (A.LibraryCall("GetPropertyElementList",Strings,Objects) == "0") {
			return inherited(pID);
		}
		return Strings;
	}*/

};

