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.

72 lines
1.5KB

  1. using RobocraftX.Blocks;
  2. using RobocraftX.Common;
  3. using Svelto.ECS;
  4. namespace TechbloxModdingAPI.Blocks
  5. {
  6. public class Servo : SignalingBlock
  7. {
  8. public Servo(EGID id) : base(id)
  9. {
  10. }
  11. public Servo(uint id) : base(new EGID(id, CommonExclusiveGroups.SERVO_BLOCK_GROUP))
  12. {
  13. }
  14. // custom servo properties
  15. /// <summary>
  16. /// The servo's minimum angle.
  17. /// </summary>
  18. public float MinimumAngle
  19. {
  20. get => BlockEngine.GetBlockInfo<ServoReadOnlyStruct>(this).minDeviation;
  21. set
  22. {
  23. BlockEngine.GetBlockInfo<ServoReadOnlyStruct>(this).minDeviation = value;
  24. }
  25. }
  26. /// <summary>
  27. /// The servo's maximum angle.
  28. /// </summary>
  29. public float MaximumAngle
  30. {
  31. get => BlockEngine.GetBlockInfo<ServoReadOnlyStruct>(this).maxDeviation;
  32. set
  33. {
  34. BlockEngine.GetBlockInfo<ServoReadOnlyStruct>(this).maxDeviation = value;
  35. }
  36. }
  37. /// <summary>
  38. /// The servo's maximum force.
  39. /// </summary>
  40. public float MaximumForce
  41. {
  42. get => BlockEngine.GetBlockInfo<ServoReadOnlyStruct>(this).servoVelocity;
  43. set
  44. {
  45. BlockEngine.GetBlockInfo<ServoReadOnlyStruct>(this).servoVelocity = value;
  46. }
  47. }
  48. /// <summary>
  49. /// The servo's direction.
  50. /// </summary>
  51. public bool Reverse
  52. {
  53. get => BlockEngine.GetBlockInfo<ServoReadOnlyStruct>(this).reverse;
  54. set
  55. {
  56. BlockEngine.GetBlockInfo<ServoReadOnlyStruct>(this).reverse = value;
  57. }
  58. }
  59. }
  60. }