rem: else console.write("Player has at least " + req + " " + resource + "."); 
context: function checkEntityReqs( player, template ) { 	// Determines if the given entity meets requirements for production by the player, and returns an appropriate 	// error string.	// A return value of 0 equals success -- entry meets requirements for production. 		// Cycle through all resources that this item costs, and check the player can afford the cost.	var resources = template.traits.creation.resource;	for( resource in resources )	{		switch( resource.toString() )		{			case "population":			case "housing": // Ignore housing. It's handled in combination with population.			break			default:				// If the item costs more of this resource type than we have,				var cur = player.resources[resource];				var req = parseInt(resources[resource]);				if (req > cur)				{					// Return an error.					return ("Insufficient " + resource + "; " + (req-cur) + " more required."); 				}				else					console.write("Player has at least " + req + " " + resource + ".");			break;		}	}		// Check if we have enough population space for the entity		if(template.traits.population && template.traits.population.rem) 	{		var req = parseInt(template.traits.population.rem);		var space = player.resources.housing - player.resources.population;			// If the item costs more of this resource type than we have,		if (req > space)		{			// Return an error.			return ("Insufficient Housing; " + (req - space) + " more required."); 		}	}	// Check if another entity must first exist. 	// Check if another tech must first be researched. 	// Check if the limit for this type of entity has been reached. 	// If we passed all checks, return success. Entity can be queued.	return true; }
meta: 1070	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1070/db0af0ef8aafc1cdbabf78512e78fb6f90f5c9a5/entity_functions.js/buggy/binaries/data/mods/official/scripts/entity_functions.js