]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Move PriceCalculationEvent and EstimatedPriceCalculationEvent to shared (#37782)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Sat, 24 May 2025 17:36:38 +0000 (19:36 +0200)
committerGitHub <noreply@github.com>
Sat, 24 May 2025 17:36:38 +0000 (19:36 +0200)
* moce PriceCalculationEvent to shared

* Update Content.Shared/Cargo/PriceCalculationEvent.cs

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
---------

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
Content.Server/Anomaly/Effects/AnomalyCoreSystem.cs
Content.Server/Armor/ArmorSystem.cs
Content.Server/Atmos/EntitySystems/GasTankSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs
Content.Server/Cargo/Systems/PricingSystem.cs
Content.Server/Power/EntitySystems/BatterySystem.cs
Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs
Content.Server/VendingMachines/VendingMachineSystem.cs
Content.Server/Weapons/Ranged/Systems/GunSystem.cs
Content.Server/Xenoarchaeology/Artifact/XenoArtifactSystem.cs
Content.Shared/Cargo/PriceCalculationEvent.cs [new file with mode: 0644]

index dea116a65e70cf5fee9524e4edbe6811cd674fa1..bb19216cb1dfbce919f456ed4f9fb80c46cd21f3 100644 (file)
@@ -1,5 +1,5 @@
-using Content.Server.Cargo.Systems;
 using Content.Shared.Anomaly.Components;
+using Content.Shared.Cargo;
 using Robust.Shared.Timing;
 
 namespace Content.Server.Anomaly.Effects;
index 915210419bbd032730633b979079a097546301cd..4ec71f217eb8486388413ca1eabd21fa960b5da5 100644 (file)
@@ -1,5 +1,5 @@
-using Content.Server.Cargo.Systems;
 using Content.Shared.Armor;
+using Content.Shared.Cargo;
 using Robust.Shared.Prototypes;
 using Content.Shared.Damage.Prototypes;
 
index 08177a7d9599b7982f011a59aad2acd488dffc08..420db3f7325f7d7cda11e4d5629eb67296ee3ab3 100644 (file)
@@ -1,8 +1,8 @@
-using Content.Server.Cargo.Systems;
 using Content.Server.Explosion.EntitySystems;
 using Content.Shared.Atmos;
 using Content.Shared.Atmos.Components;
 using Content.Shared.Atmos.EntitySystems;
+using Content.Shared.Cargo;
 using Content.Shared.Throwing;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
index a8f505ca5d7a70bc8d31b09c21916a5f9aec1676..14c85620b185ac02ccb9d4015224ec83b8c9b476 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Server.Atmos.EntitySystems;
 using Content.Server.Atmos.Piping.Components;
-using Content.Server.Cargo.Systems;
 using Content.Server.NodeContainer.EntitySystems;
 using Content.Server.NodeContainer.NodeGroups;
 using Content.Server.NodeContainer.Nodes;
@@ -8,6 +7,7 @@ using Content.Shared.Atmos;
 using Content.Shared.Atmos.Components;
 using Content.Shared.Atmos.Piping.Binary.Components;
 using Content.Shared.Atmos.Piping.Unary.Systems;
+using Content.Shared.Cargo;
 using Content.Shared.Database;
 using Content.Shared.NodeContainer;
 using GasCanisterComponent = Content.Shared.Atmos.Piping.Unary.Components.GasCanisterComponent;
index 3d8a8075f5556c4afa2ba6dfe06851b622b60b0b..5e449eb8daac61c251896dba9ae27db8ed2444fd 100644 (file)
@@ -4,6 +4,7 @@ using Content.Server.Cargo.Components;
 using Content.Shared.Chemistry.EntitySystems;
 using Content.Shared.Administration;
 using Content.Shared.Body.Components;
+using Content.Shared.Cargo;
 using Content.Shared.Chemistry.Components.SolutionManager;
 using Content.Shared.Chemistry.Reagent;
 using Content.Shared.Materials;
@@ -183,10 +184,7 @@ public sealed class PricingSystem : EntitySystem
     /// </summary>
     public double GetEstimatedPrice(EntityPrototype prototype)
     {
-        var ev = new EstimatedPriceCalculationEvent()
-        {
-            Prototype = prototype,
-        };
+        var ev = new EstimatedPriceCalculationEvent(prototype);
 
         RaiseLocalEvent(ref ev);
 
@@ -399,39 +397,3 @@ public sealed class PricingSystem : EntitySystem
         return price;
     }
 }
-
-/// <summary>
-/// A directed by-ref event fired on an entity when something needs to know it's price. This value is not cached.
-/// </summary>
-[ByRefEvent]
-public record struct PriceCalculationEvent()
-{
-    /// <summary>
-    /// The total price of the entity.
-    /// </summary>
-    public double Price = 0;
-
-    /// <summary>
-    /// Whether this event was already handled.
-    /// </summary>
-    public bool Handled = false;
-}
-
-/// <summary>
-/// Raised broadcast for an entity prototype to determine its estimated price.
-/// </summary>
-[ByRefEvent]
-public record struct EstimatedPriceCalculationEvent()
-{
-    public required EntityPrototype Prototype;
-
-    /// <summary>
-    /// The total price of the entity.
-    /// </summary>
-    public double Price = 0;
-
-    /// <summary>
-    /// Whether this event was already handled.
-    /// </summary>
-    public bool Handled = false;
-}
index a0ce3ddaade9e7777dd2b4bbc2216645eb08a548..f4e48f4a3dceb742fca1239dbd23acfd0af9f235 100644 (file)
@@ -1,9 +1,8 @@
-using Content.Server.Cargo.Systems;
 using Content.Server.Emp;
 using Content.Server.Power.Components;
+using Content.Shared.Cargo;
 using Content.Shared.Examine;
 using Content.Shared.Rejuvenate;
-using Content.Shared.Timing;
 using JetBrains.Annotations;
 using Robust.Shared.Utility;
 using Robust.Shared.Timing;
index 1fd617c539fb69d12875a33449c59dcffabc549b..548fa7bfda3de308a6438e827c8a811ed32863f6 100644 (file)
@@ -1,6 +1,7 @@
 using Content.Server.Administration.Logs;
 using Content.Server.Cargo.Systems;
 using Content.Server.Storage.Components;
+using Content.Shared.Cargo;
 using Content.Shared.Database;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction.Events;
index bd95c92327b04f969c628c6a5f36fc08912020da..954c5d6ca1ca41eec07c9e4acbf3a852f505b814 100644 (file)
@@ -4,6 +4,7 @@ using Content.Server.Cargo.Systems;
 using Content.Server.Emp;
 using Content.Server.Power.Components;
 using Content.Server.Power.EntitySystems;
+using Content.Shared.Cargo;
 using Content.Shared.Damage;
 using Content.Shared.Destructible;
 using Content.Shared.DoAfter;
index 6ee3baae657527820b3e62d13d274d628e50f06a..e04fa9b64c4bdd44866b1ef39c0df9abb392dd84 100644 (file)
@@ -1,8 +1,8 @@
 using System.Linq;
 using System.Numerics;
 using Content.Server.Cargo.Systems;
-using Content.Server.Power.EntitySystems;
 using Content.Server.Weapons.Ranged.Components;
+using Content.Shared.Cargo;
 using Content.Shared.Damage;
 using Content.Shared.Damage.Systems;
 using Content.Shared.Database;
@@ -22,7 +22,6 @@ using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
 using Robust.Shared.Containers;
-using Content.Server.PowerCell;
 
 namespace Content.Server.Weapons.Ranged.Systems;
 
index fbea515dc356808e2d302a425b64f14dc920aa1d..312090c9d07e38463390b0818dc5bae36cec2d00 100644 (file)
@@ -1,4 +1,4 @@
-using Content.Server.Cargo.Systems;
+using Content.Shared.Cargo;
 using Content.Shared.Xenoarchaeology.Artifact;
 using Content.Shared.Xenoarchaeology.Artifact.Components;
 
diff --git a/Content.Shared/Cargo/PriceCalculationEvent.cs b/Content.Shared/Cargo/PriceCalculationEvent.cs
new file mode 100644 (file)
index 0000000..5d10495
--- /dev/null
@@ -0,0 +1,38 @@
+using Robust.Shared.Prototypes;
+
+namespace Content.Shared.Cargo;
+
+/// <summary>
+/// A directed by-ref event fired on an entity when something needs to know its price. This value is not cached.
+/// </summary>
+[ByRefEvent]
+public record struct PriceCalculationEvent()
+{
+    /// <summary>
+    /// The total price of the entity.
+    /// </summary>
+    public double Price = 0;
+
+    /// <summary>
+    /// Whether this event was already handled.
+    /// </summary>
+    public bool Handled = false;
+}
+
+/// <summary>
+/// Raised broadcast for an entity prototype to determine its estimated price.
+/// </summary>
+/// <param name="Prototype">The prototype to estimate the price for.</param>
+[ByRefEvent]
+public record struct EstimatedPriceCalculationEvent(EntityPrototype Prototype)
+{
+    /// <summary>
+    /// The total price of the entity.
+    /// </summary>
+    public double Price = 0;
+
+    /// <summary>
+    /// Whether this event was already handled.
+    /// </summary>
+    public bool Handled = false;
+}