From faca40b8d518aa7bff4213035fed1e2446bdd3a1 Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Sat, 24 Dec 2022 23:28:21 -0500 Subject: [PATCH] more component ref removal + combining server/client comps (#13178) Co-authored-by: DrSmugleaf --- Content.Client/Flash/FlashSystem.cs | 2 - Content.Client/Flash/FlashableComponent.cs | 12 - Content.Client/Humanoid/HumanoidComponent.cs | 15 -- .../Humanoid/HumanoidVisualizerSystem.cs | 40 +-- .../Projectiles/ProjectileComponent.cs | 8 - .../Components/SingularityComponent.cs | 13 - .../Singularity/Systems/SingularitySystem.cs | 4 +- Content.Client/Stack/StackComponent.cs | 18 -- Content.Client/Stack/StackStatusControl.cs | 1 + Content.Client/Stack/StackSystem.cs | 2 +- .../Tools/Components/MultipleToolComponent.cs | 11 - Content.Client/Tools/ToolSystem.cs | 4 +- .../VendingMachineComponent.cs | 60 ----- .../VendingMachines/VendingMachineSystem.cs | 16 -- .../Ranged/Systems/FlyBySoundSystem.cs | 4 +- .../Systems/AdminVerbSystem.Tools.cs | 1 + Content.Server/Advertise/AdvertiseSystem.cs | 1 + Content.Server/Cargo/Systems/PricingSystem.cs | 1 + Content.Server/Cloning/CloningSystem.cs | 1 + .../Construction/Completions/GivePrototype.cs | 1 + .../Completions/SpawnPrototype.cs | 1 + .../Construction/MachineFrameSystem.cs | 1 + Content.Server/Construction/RefiningSystem.cs | 1 + .../Thresholds/Behaviors/EjectVendorItems.cs | 1 + .../Behaviors/SpawnEntitiesBehavior.cs | 1 + Content.Server/Dragon/DragonSystem.cs | 2 +- .../EntitySystems/SpawnAfterInteractSystem.cs | 2 +- .../Flash/Components/FlashableComponent.cs | 10 - .../GameTicking/Rules/ZombieRuleSystem.cs | 3 +- Content.Server/Hands/Systems/HandsSystem.cs | 1 + .../Humanoid/Components/HumanoidComponent.cs | 38 --- .../Systems/RandomHumanoidAppearanceSystem.cs | 1 + .../IdentityManagement/IdentitySystem.cs | 3 +- .../EntitySystems/ReagentGrinderSystem.cs | 1 + .../MagicMirror/MagicMirrorSystem.cs | 1 + .../BiomassReclaimerSystem.cs | 3 +- Content.Server/Medical/HealingSystem.cs | 2 +- .../Components/ParticleProjectileComponent.cs | 2 +- .../Power/EntitySystems/CableSystem.Placer.cs | 1 + .../Components/ProjectileComponent.cs | 29 --- .../Projectiles/SharedProjectileSystem.cs | 1 - .../EntitySystems/RevenantSystem.Abilities.cs | 1 + .../EntitySystems/EmitterSystem.cs | 3 +- .../EntitySystems/SingularitySystem.cs | 10 +- Content.Server/Stack/StackComponent.cs | 13 - Content.Server/Stack/StackSystem.cs | 6 +- .../Store/Conditions/BuyerSpeciesCondition.cs | 1 + Content.Server/Store/Systems/StoreSystem.cs | 1 + Content.Server/Tiles/FloorTileSystem.cs | 1 + .../Tools/Components/MultipleToolComponent.cs | 9 - .../VendingMachineComponent.cs | 80 ------ .../VendingMachines/VendingMachineSystem.cs | 7 +- .../Ranged/Systems/GunSystem.Battery.cs | 2 +- .../Ranged/Systems/GunSystem.Cartridges.cs | 2 +- .../Weapons/Ranged/Systems/GunSystem.cs | 3 +- .../Steps/MaterialConstructionGraphStep.cs | 6 +- ...ableComponent.cs => FlashableComponent.cs} | 8 +- Content.Shared/Flash/SharedFlashSystem.cs | 4 +- ...anoidComponent.cs => HumanoidComponent.cs} | 40 ++- .../Materials/SharedMaterialStorageSystem.cs | 2 +- ...ileComponent.cs => ProjectileComponent.cs} | 24 +- .../Projectiles/SharedProjectileSystem.cs | 6 +- .../Components/SharedSingularityComponent.cs | 32 --- .../Components/SingularityComponent.cs | 51 ++-- .../EntitySystems/SharedSingularitySystem.cs | 44 ++-- .../Events/SingularityLevelChangedEvent.cs | 4 +- Content.Shared/Stacks/SharedStackSystem.cs | 48 ++-- ...redStackComponent.cs => StackComponent.cs} | 10 +- Content.Shared/Stacks/StackPrototype.cs | 2 +- ...lComponent.cs => MultipleToolComponent.cs} | 20 +- .../Systems/SharedToolSystem.MultipleTool.cs | 20 +- .../SharedVendingMachineComponent.cs | 100 -------- .../SharedVendingMachineSystem.cs | 13 +- .../VendingMachineComponent.cs | 241 ++++++++++++++++++ .../Objects/Consumable/Food/Baked/misc.yml | 3 - .../Smokeables/Cigarettes/rolling_paper.yml | 2 - .../Structures/Machines/vending_machines.yml | 2 +- .../Prototypes/Stacks/consumable_stacks.yml | 6 +- 78 files changed, 504 insertions(+), 643 deletions(-) delete mode 100644 Content.Client/Flash/FlashableComponent.cs delete mode 100644 Content.Client/Humanoid/HumanoidComponent.cs delete mode 100644 Content.Client/Projectiles/ProjectileComponent.cs delete mode 100644 Content.Client/Singularity/Components/SingularityComponent.cs delete mode 100644 Content.Client/Stack/StackComponent.cs delete mode 100644 Content.Client/VendingMachines/VendingMachineComponent.cs delete mode 100644 Content.Server/Flash/Components/FlashableComponent.cs delete mode 100644 Content.Server/Humanoid/Components/HumanoidComponent.cs delete mode 100644 Content.Server/Projectiles/Components/ProjectileComponent.cs delete mode 100644 Content.Server/Stack/StackComponent.cs delete mode 100644 Content.Server/Tools/Components/MultipleToolComponent.cs delete mode 100644 Content.Server/VendingMachines/VendingMachineComponent.cs rename Content.Shared/Flash/{SharedFlashableComponent.cs => FlashableComponent.cs} (70%) rename Content.Shared/Humanoid/{SharedHumanoidComponent.cs => HumanoidComponent.cs} (57%) rename Content.Shared/Projectiles/{SharedProjectileComponent.cs => ProjectileComponent.cs} (50%) delete mode 100644 Content.Shared/Singularity/Components/SharedSingularityComponent.cs rename {Content.Server => Content.Shared}/Singularity/Components/SingularityComponent.cs (55%) rename Content.Shared/Stacks/{SharedStackComponent.cs => StackComponent.cs} (84%) rename Content.Shared/Tools/Components/{SharedMultipleToolComponent.cs => MultipleToolComponent.cs} (67%) delete mode 100644 Content.Shared/VendingMachines/SharedVendingMachineComponent.cs create mode 100644 Content.Shared/VendingMachines/VendingMachineComponent.cs diff --git a/Content.Client/Flash/FlashSystem.cs b/Content.Client/Flash/FlashSystem.cs index 9cdfd61e03..3393662fa4 100644 --- a/Content.Client/Flash/FlashSystem.cs +++ b/Content.Client/Flash/FlashSystem.cs @@ -1,9 +1,7 @@ using Content.Shared.Flash; using Robust.Client.Graphics; using Robust.Client.Player; -using Robust.Shared.GameObjects; using Robust.Shared.GameStates; -using Robust.Shared.IoC; using Robust.Shared.Timing; namespace Content.Client.Flash diff --git a/Content.Client/Flash/FlashableComponent.cs b/Content.Client/Flash/FlashableComponent.cs deleted file mode 100644 index 714d2d7c1c..0000000000 --- a/Content.Client/Flash/FlashableComponent.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Content.Shared.Flash; -using Robust.Shared.Analyzers; -using Robust.Shared.GameObjects; - -namespace Content.Client.Flash -{ - [ComponentReference(typeof(SharedFlashableComponent))] - [RegisterComponent, Access(typeof(FlashSystem))] - public sealed class FlashableComponent : SharedFlashableComponent - { - } -} diff --git a/Content.Client/Humanoid/HumanoidComponent.cs b/Content.Client/Humanoid/HumanoidComponent.cs deleted file mode 100644 index d433013c9d..0000000000 --- a/Content.Client/Humanoid/HumanoidComponent.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Content.Shared.Humanoid; -using Content.Shared.Humanoid.Markings; -using Content.Shared.Humanoid.Prototypes; - -namespace Content.Client.Humanoid; - -[RegisterComponent] -public sealed class HumanoidComponent : SharedHumanoidComponent -{ - [ViewVariables] public List CurrentMarkings = new(); - - public Dictionary BaseLayers = new(); - - public string LastSpecies = default!; -} diff --git a/Content.Client/Humanoid/HumanoidVisualizerSystem.cs b/Content.Client/Humanoid/HumanoidVisualizerSystem.cs index 808a5a1ba7..5539ec27d1 100644 --- a/Content.Client/Humanoid/HumanoidVisualizerSystem.cs +++ b/Content.Client/Humanoid/HumanoidVisualizerSystem.cs @@ -108,23 +108,23 @@ public sealed class HumanoidVisualizerSystem : VisualizerSystem(); - var dirtyRangeStart = humanoid.CurrentMarkings.Count == 0 ? 0 : -1; + var dirtyRangeStart = humanoid.CurrentClientMarkings.Count == 0 ? 0 : -1; // edge cases: - // humanoid.CurrentMarkings < newMarkings.Count + // humanoid.CurrentClientMarkings < newMarkings.Count // - check if count matches this condition before diffing - // - if count is unequal, set dirty range to start from humanoid.CurrentMarkings.Count - // humanoid.CurrentMarkings > newMarkings.Count, no dirty markings + // - if count is unequal, set dirty range to start from humanoid.CurrentClientMarkings.Count + // humanoid.CurrentClientMarkings > newMarkings.Count, no dirty markings // - break count upon meeting this condition - // - clear markings from newMarkings.Count to humanoid.CurrentMarkings.Count - newMarkings.Count + // - clear markings from newMarkings.Count to humanoid.CurrentClientMarkings.Count - newMarkings.Count - for (var i = 0; i < humanoid.CurrentMarkings.Count; i++) + for (var i = 0; i < humanoid.CurrentClientMarkings.Count; i++) { // if we've reached the end of the new set of markings, // then that means it's time to finish @@ -135,7 +135,7 @@ public sealed class HumanoidVisualizerSystem : VisualizerSystem