A stable modding interface between Techblox and mods https://mod.exmods.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.5KB

  1. using RobocraftX.Blocks;
  2. using RobocraftX.Common;
  3. using Svelto.ECS;
  4. namespace TechbloxModdingAPI.Blocks
  5. {
  6. public class DampedSpring : Block
  7. {
  8. public DampedSpring(EGID id) : base(id)
  9. {
  10. }
  11. public DampedSpring(uint id) : base(new EGID(id, CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP))
  12. {
  13. }
  14. /// <summary>
  15. /// The spring's maximum force. This is known as Stiffness in-game
  16. /// </summary>
  17. public float MaxForce
  18. {
  19. get => BlockEngine.GetBlockInfo<DampedSpringReadOnlyStruct>(this).springFrequency;
  20. set => BlockEngine.GetBlockInfo<DampedSpringReadOnlyStruct>(this).springFrequency = value;
  21. }
  22. /// <summary>
  23. /// Alias of MaxForce.
  24. /// </summary>
  25. public float Stiffness
  26. {
  27. get => MaxForce;
  28. set => MaxForce = value;
  29. }
  30. /// <summary>
  31. /// The spring's maximum damping force.
  32. /// </summary>
  33. public float Damping
  34. {
  35. get => BlockEngine.GetBlockInfo<DampedSpringReadOnlyStruct>(this).springDamping;
  36. set => BlockEngine.GetBlockInfo<DampedSpringReadOnlyStruct>(this).springDamping = value;
  37. }
  38. /// <summary>
  39. /// The spring's maximum extension.
  40. /// </summary>
  41. public float MaxExtension
  42. {
  43. get => BlockEngine.GetBlockInfo<DampedSpringReadOnlyStruct>(this).maxExtent;
  44. set => BlockEngine.GetBlockInfo<DampedSpringReadOnlyStruct>(this).maxExtent = value;
  45. }
  46. }
  47. }