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
2.0KB

  1. namespace TechbloxModdingAPI.Blocks
  2. {
  3. using RobocraftX.Common;
  4. using Svelto.ECS;
  5. public class Motor : SignalingBlock
  6. {
  7. /// <summary>
  8. /// Constructs a(n) Motor object representing an existing block.
  9. /// </summary>
  10. public Motor(EGID egid) :
  11. base(egid)
  12. {
  13. }
  14. /// <summary>
  15. /// Constructs a(n) Motor object representing an existing block.
  16. /// </summary>
  17. public Motor(uint id) :
  18. base(new EGID(id, CommonExclusiveGroups.MOTOR_BLOCK_GROUP))
  19. {
  20. }
  21. /// <summary>
  22. /// Gets or sets the Motor's TopSpeed property. Tweakable stat.
  23. /// </summary>
  24. public float TopSpeed
  25. {
  26. get
  27. {
  28. return BlockEngine.GetBlockInfo<RobocraftX.Blocks.MotorReadOnlyStruct>(this).maxVelocity;
  29. }
  30. set
  31. {
  32. BlockEngine.GetBlockInfo<RobocraftX.Blocks.MotorReadOnlyStruct>(this).maxVelocity = value;
  33. }
  34. }
  35. /// <summary>
  36. /// Gets or sets the Motor's Torque property. Tweakable stat.
  37. /// </summary>
  38. public float Torque
  39. {
  40. get
  41. {
  42. return BlockEngine.GetBlockInfo<RobocraftX.Blocks.MotorReadOnlyStruct>(this).maxForce;
  43. }
  44. set
  45. {
  46. BlockEngine.GetBlockInfo<RobocraftX.Blocks.MotorReadOnlyStruct>(this).maxForce = value;
  47. }
  48. }
  49. /// <summary>
  50. /// Gets or sets the Motor's Reverse property. Tweakable stat.
  51. /// </summary>
  52. public bool Reverse
  53. {
  54. get
  55. {
  56. return BlockEngine.GetBlockInfo<RobocraftX.Blocks.MotorReadOnlyStruct>(this).reverse;
  57. }
  58. set
  59. {
  60. BlockEngine.GetBlockInfo<RobocraftX.Blocks.MotorReadOnlyStruct>(this).reverse = value;
  61. }
  62. }
  63. }
  64. }