1
0

InternalTemperatureComponent.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using Content.Server.Temperature.Systems;
  2. namespace Content.Server.Temperature.Components;
  3. /// <summary>
  4. /// Entity has an internal temperature which conducts heat from its surface.
  5. /// Requires <see cref="TemperatureComponent"/> to function.
  6. /// </summary>
  7. /// <remarks>
  8. /// Currently this is only used for cooking but animal metabolism could use it too.
  9. /// Too hot? Suffering heatstroke, start sweating to cool off and increase thirst.
  10. /// Too cold? Suffering hypothermia, start shivering to warm up and increase hunger.
  11. /// </remarks>
  12. [RegisterComponent, Access(typeof(TemperatureSystem))]
  13. public sealed partial class InternalTemperatureComponent : Component
  14. {
  15. /// <summary>
  16. /// Internal temperature which is modified by surface temperature.
  17. /// This gets set to <see cref="TemperatureComponent.CurrentTemperature"/> on mapinit.
  18. /// </summary>
  19. [DataField, ViewVariables(VVAccess.ReadWrite)]
  20. public float Temperature;
  21. /// <summary>
  22. /// Thermal conductivity of the material in W/m/K.
  23. /// Higher conductivity means its insides will heat up faster.
  24. /// </summary>
  25. [DataField, ViewVariables(VVAccess.ReadWrite)]
  26. public float Conductivity = 0.5f;
  27. /// <summary>
  28. /// Average thickness between the surface and the inside.
  29. /// For meats and such this is constant.
  30. /// Thicker materials take longer for heat to dissipate.
  31. /// </summary>
  32. [DataField(required: true), ViewVariables(VVAccess.ReadWrite)]
  33. public float Thickness;
  34. /// <summary>
  35. /// Surface area in m^2 for the purpose of conducting surface temperature to the inside.
  36. /// Larger surface area means it takes longer to heat up/cool down
  37. /// </summary>
  38. /// <remarks>
  39. /// For meats etc this should just be the area of the cooked surface not the whole thing as it's only getting heat from one side usually.
  40. /// </remarks>
  41. [DataField(required: true), ViewVariables(VVAccess.ReadWrite)]
  42. public float Area;
  43. }