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.

41 lines
1.3KB

  1. using Gamecraft.Damage;
  2. using RobocraftX.Common;
  3. using Svelto.ECS;
  4. namespace GamecraftModdingAPI
  5. {
  6. /// <summary>
  7. /// Represnts a cluster of blocks in time running mode, meaning blocks that are connected either directly or via joints.
  8. /// </summary>
  9. public class Cluster
  10. {
  11. public EGID Id { get; }
  12. public Cluster(EGID id)
  13. {
  14. Id = id;
  15. }
  16. public Cluster(uint id) : this(new EGID(id, CommonExclusiveGroups.SIMULATION_CLUSTERS_GROUP))
  17. {
  18. }
  19. public float InitialHealth
  20. {
  21. get => Block.BlockEngine.GetBlockInfo<HealthEntityComponent>(Id).initialHealth;
  22. set => Block.BlockEngine.GetBlockInfo<HealthEntityComponent>(Id).initialHealth = value;
  23. }
  24. public float CurrentHealth
  25. {
  26. get => Block.BlockEngine.GetBlockInfo<HealthEntityComponent>(Id).currentHealth;
  27. set => Block.BlockEngine.GetBlockInfo<HealthEntityComponent>(Id).currentHealth = value;
  28. }
  29. public float HealthMultiplier
  30. {
  31. get => Block.BlockEngine.GetBlockInfo<HealthEntityComponent>(Id).healthMultiplier;
  32. set => Block.BlockEngine.GetBlockInfo<HealthEntityComponent>(Id).healthMultiplier = value;
  33. }
  34. }
  35. }