20 lines
		
	
	
		
			670 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
		
		
			
		
	
	
			20 lines
		
	
	
		
			670 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
|  | local CookMaterialUtils = {} | ||
|  | local Utils = require("GamePlay.Utils") | ||
|  | 
 | ||
|  | function CookMaterialUtils.TemperatureToDoneness(temperature) | ||
|  |     return math.floor(temperature / 70) | ||
|  | end | ||
|  | 
 | ||
|  | function CookMaterialUtils.GetCookwareOpNextState(cookward_id, cook_material_id, temperature) | ||
|  |     local config = Utils.GetDataTableConfig( | ||
|  |         "CookMaterialStateConfig", cook_material_id | ||
|  |     ) | ||
|  |     if not config then return nil end | ||
|  |     local doneness = CookMaterialUtils.TemperatureToDoneness(temperature) | ||
|  |     local doneness_config = config.CookConfig:Get(doneness) | ||
|  |     if not doneness_config then return nil end | ||
|  |     return doneness_config.CookwareNextStateID | ||
|  | end | ||
|  | 
 | ||
|  | 
 | ||
|  | return CookMaterialUtils |