1
0

CompostingComponent.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Robust.Shared.GameObjects;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
  4. using System.Collections.Generic;
  5. using Content.Shared.Tag;
  6. namespace Content.Shared.Composting;
  7. [RegisterComponent]
  8. public sealed partial class CompostingComponent : Component
  9. {
  10. /// <summary>
  11. /// List of tags allowed for composting (e.g., "Fruit", "Egg", "Meat").
  12. /// </summary>
  13. [DataField("whitelist", customTypeSerializer: typeof(PrototypeIdListSerializer<TagPrototype>))]
  14. public List<string> Whitelist = new();
  15. /// <summary>
  16. /// Time in minutes for each item to be composted.
  17. /// </summary>
  18. [DataField("compostTime")]
  19. public float CompostTime = 6.0f;
  20. /// <summary>
  21. /// Items currently being composted and their completion times.
  22. /// </summary>
  23. [DataField("compostingItems")]
  24. public Dictionary<EntityUid, TimeSpan> CompostingItems = new();
  25. /// <summary>
  26. /// Amount of finished compost ready to be collected.
  27. /// </summary>
  28. [DataField("readyCompost")]
  29. public int ReadyCompost = 0;
  30. /// <summary>
  31. /// Maximum items amount (composting + ready compost) that it can hold
  32. /// </summary>
  33. [DataField("maxCapacity")]
  34. public int MaxCapacity = 10;
  35. }