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.

51 lines
1.1KB

  1. using System;
  2. using RobocraftX.Blocks;
  3. using Svelto.ECS;
  4. using Unity.Mathematics;
  5. using TechbloxModdingAPI.Utility;
  6. using RobocraftX.Common;
  7. namespace TechbloxModdingAPI.Blocks
  8. {
  9. public class Piston : SignalingBlock
  10. {
  11. public Piston(EGID id) : base(id)
  12. {
  13. }
  14. public Piston(uint id) : base(new EGID(id, CommonExclusiveGroups.PISTON_BLOCK_GROUP))
  15. {
  16. }
  17. // custom piston properties
  18. /// <summary>
  19. /// The piston's max extension distance.
  20. /// </summary>
  21. public float MaximumExtension
  22. {
  23. get => BlockEngine.GetBlockInfo<PistonReadOnlyStruct>(this).maxDeviation;
  24. set
  25. {
  26. BlockEngine.GetBlockInfo<PistonReadOnlyStruct>(this).maxDeviation = value;
  27. }
  28. }
  29. /// <summary>
  30. /// The piston's max extension force.
  31. /// </summary>
  32. public float MaximumForce
  33. {
  34. get => BlockEngine.GetBlockInfo<PistonReadOnlyStruct>(this).pistonVelocity;
  35. set
  36. {
  37. BlockEngine.GetBlockInfo<PistonReadOnlyStruct>(this).pistonVelocity = value;
  38. }
  39. }
  40. }
  41. }