rem: localPlayer.resource[resource.toString().toUpperCase()] -= pool[resource].cost; 
add: getGUIGlobal().deductResources(resource.toString(), parseInt(pool[resource].cost)); 
context: function attempt_add_to_build_queue( entity, create_tag, list, tab ){	result = entity_CheckQueueReq (entity);	if (result == "true") // If the entry meets requirements to be added to the queue (eg sufficient resources) 	{		// Cycle through all costs of this entry.		pool = entity.traits.creation.resource;		for( resource in pool )		{			switch( resource.toString().toUpperCase() )			{				case "POPULATION" || "HOUSING":				break;				default:					// Deduct the given quantity of resources.					localPlayer.resource[resource.toString().toUpperCase()] -= pool[resource].cost;					console.write("Spent " + pool[resource].cost + " " + resource + ".");				break;			}		}		// Add entity to queue.		console.write( "Adding ", create_tag, " to build queue..." );		entity.add_create_queue( getEntityTemplate( create_tag ), list, tab );	}	else		// If not, output the error message.		console.write(result);}
meta: 1070	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1070/580cbdef5256984392214ed10a0aa9260f682d48/template_entity_script.js/buggy/binaries/data/mods/official/entities/template_entity_script.js