rem: console.write ("Spent " + pool[resource] + " " + resource + " to purchase " + template.traits.id.generic); 
add: /*console.write ("Spent " + pool[resource] + " " + resource + " to purchase " + template.traits.id.generic);*/ 
context: function entityStartProduction( evt ){	console.write("StartProduction: " + evt.productionType + " " + evt.name);		if( evt.productionType == PRODUCTION_TRAIN ) 	{		var template = getEntityTemplate( evt.name, this.player );		var result = checkEntityReqs( this.player, template );			if (result == true) // If the entry meets requirements to be added to the queue (eg sufficient resources) 		{			// Cycle through all costs of this entry.			var pool = template.traits.creation.resource;			for ( resource in pool )			{				switch ( resource.toString() )				{					case "population":					case "housing":					break;					default:						// Deduct the given quantity of resources.						this.player.resources[resource.toString()] -= parseInt(pool[resource]);						console.write ("Spent " + pool[resource] + " " + resource + " to purchase " + 							template.traits.id.generic);					break;				}			}						// Reserve population space for the unit			if( template.traits.population && template.traits.population.rem )			{				this.player.resources.population += parseInt(template.traits.population.rem);			}				// Set the amount of time it will take to complete production of the production object.			evt.time = getEntityTemplate( evt.name, this.player ).traits.creation.time;		}		else		{				// If not, output the error message.			console.write(result);			evt.preventDefault();			return;		}	}	else if( evt.productionType == PRODUCTION_RESEARCH ) 	{		var tech = getTechnology( evt.name, this.player );				if( !tech )		{			console.write( "No such tech: " + evt.name );			evt.preventDefault();			return;		}				// Check tech requirements other than resources		if( !tech.isValid() ) 		{			console.write( "Tech " + evt.name + " is currently unavailable" );			evt.preventDefault();			return;		}				// Check for sufficient resources		for( i in TECH_RESOURCES )		{			var res = TECH_RESOURCES[i];			if( this.player.resources[res] < tech[res] )			{				console.write( "Cannot afford " + evt.name + ": need " + tech[res] + " " + res );				evt.preventDefault();				return;			}		}				// Subtract resources		for( i in TECH_RESOURCES )		{			var res = TECH_RESOURCES[i];			this.player.resources[res] -= tech[res];		}				// Mark it as in progress		tech.in_progress = true;				// Set the amount of time it will take to complete production of the tech.		evt.time = tech.time;	}	else	{		evt.preventDefault();	}}
meta: 1070	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1070/cb07a8b88da0b45aa91a36a9cf709b284ea006ce/entity_functions.js/clean/binaries/data/mods/official/scripts/entity_functions.js