Files
BusyRabbit/Content/Lua/Utils/Cook/CookMaterial.lua

20 lines
670 B
Lua
Raw Normal View History

2025-08-08 17:22:47 +08:00
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