rem: localPlayer.resource.valueOf()[resourceNameU] = resourceQty; 
add: localPlayer.resource.valueOf()[resourceName] = resourceQty; 
context: function addResource (resourceName, resourceQty){	// Creates a resource type.	// Ensure resource name is title-case.	resourceName = toTitleCase (resourceName);	// Create uppercase name.	resourceNameU = resourceName.toUpperCase();	if (!localPlayer.resource)	{		// Define the base resource group if it does not exist.		localPlayer.resource = new Array();		// Set the length of the array.		localPlayer.resource.length = 0;		// Create the UI resource array container if it does not exist.		resourceUIArray = new Array;	}		// Store resource's name and starting value.	localPlayer.resource.valueOf()[resourceNameU] = resourceQty;		// The array is now one index longer.	localPlayer.resource.length++;		// We maintain a sorted array of the resource indexes so that the UI counters can be refreshed in centered order.	// (We don't include Housing in the list, though, as it does not have its own resource counter.)	if (resourceName != "Housing")	{		//  If it's an even index,		if ((localPlayer.resource.length-1) % 2 == 0)			// Add it to the end of the UI array.			resourceUIArray.push ((localPlayer.resource.length-1));		else			// Add it to the beginning of the UI array,			resourceUIArray.unshift ((localPlayer.resource.length-1));	}			// Dynamically adjust width of resource counter based on caption length.	refreshResources();				console.write( "Added " + resourceName + " (" + resourceQty + ")" );}
meta: 1070	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1070/b73622196e03cfe48613fb7047cf6c61ceaf24b0/functions_sim_player.js/clean/binaries/data/mods/official/gui/test/functions_sim_player.js