Removed the StateType property from every component. This field was completely unused except for a debug assertion.

This commit is contained in:
Acruid
2020-01-24 14:10:36 -08:00
parent 0f1cee44a3
commit 4ab7f1dcb3
24 changed files with 4 additions and 33 deletions

View File

@@ -1,5 +1,4 @@
using System; using Content.Shared.GameObjects;
using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Inventory; using Content.Shared.GameObjects.Components.Inventory;
using Content.Shared.GameObjects.Components.Items; using Content.Shared.GameObjects.Components.Items;
using Robust.Client.Graphics; using Robust.Client.Graphics;
@@ -16,7 +15,6 @@ namespace Content.Client.GameObjects.Components.Clothing
private FemaleClothingMask _femaleMask; private FemaleClothingMask _femaleMask;
public override string Name => "Clothing"; public override string Name => "Clothing";
public override uint? NetID => ContentNetIDs.CLOTHING; public override uint? NetID => ContentNetIDs.CLOTHING;
public override Type StateType => typeof(ClothingComponentState);
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
public string ClothingEquippedPrefix { get; set; } public string ClothingEquippedPrefix { get; set; }

View File

@@ -1,5 +1,4 @@
using System; using Content.Shared.GameObjects;
using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Items; using Content.Shared.GameObjects.Components.Items;
using Robust.Client.Graphics; using Robust.Client.Graphics;
using Robust.Client.Interfaces.ResourceManagement; using Robust.Client.Interfaces.ResourceManagement;
@@ -18,7 +17,6 @@ namespace Content.Client.GameObjects
{ {
public override string Name => "Item"; public override string Name => "Item";
public override uint? NetID => ContentNetIDs.ITEM; public override uint? NetID => ContentNetIDs.ITEM;
public override Type StateType => typeof(ItemComponentState);
[ViewVariables] protected ResourcePath RsiPath; [ViewVariables] protected ResourcePath RsiPath;

View File

@@ -70,7 +70,6 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged
public override string Name => "BallisticMagazineWeapon"; public override string Name => "BallisticMagazineWeapon";
public override uint? NetID => ContentNetIDs.BALLISTIC_MAGAZINE_WEAPON; public override uint? NetID => ContentNetIDs.BALLISTIC_MAGAZINE_WEAPON;
public override Type StateType => typeof(BallisticMagazineWeaponComponentState);
private StatusControl _statusControl; private StatusControl _statusControl;

View File

@@ -17,7 +17,6 @@ namespace Content.Client.GameObjects.Components
{ {
public override string Name => "Welder"; public override string Name => "Welder";
public override uint? NetID => ContentNetIDs.WELDER; public override uint? NetID => ContentNetIDs.WELDER;
public override Type StateType => typeof(WelderComponentState);
[ViewVariables] public float FuelCapacity { get; private set; } [ViewVariables] public float FuelCapacity { get; private set; }
[ViewVariables] public float Fuel { get; private set; } [ViewVariables] public float Fuel { get; private set; }

View File

@@ -19,7 +19,6 @@ namespace Content.Server.GameObjects
{ {
public override string Name => "Clothing"; public override string Name => "Clothing";
public override uint? NetID => ContentNetIDs.CLOTHING; public override uint? NetID => ContentNetIDs.CLOTHING;
public override Type StateType => typeof(ClothingComponentState);
public SlotFlags SlotFlags = SlotFlags.PREVENTEQUIP; //Different from None, NONE allows equips if no slot flags are required public SlotFlags SlotFlags = SlotFlags.PREVENTEQUIP; //Different from None, NONE allows equips if no slot flags are required

View File

@@ -1,5 +1,4 @@
using System; using Content.Server.GameObjects.EntitySystems;
using Content.Server.GameObjects.EntitySystems;
using Content.Server.Interfaces.GameObjects; using Content.Server.Interfaces.GameObjects;
using Content.Shared.GameObjects; using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Items; using Content.Shared.GameObjects.Components.Items;
@@ -21,7 +20,6 @@ namespace Content.Server.GameObjects
{ {
public override string Name => "Item"; public override string Name => "Item";
public override uint? NetID => ContentNetIDs.ITEM; public override uint? NetID => ContentNetIDs.ITEM;
public override Type StateType => typeof(ItemComponentState);
#pragma warning disable 649 #pragma warning disable 649
[Dependency] private readonly IRobustRandom _robustRandom; [Dependency] private readonly IRobustRandom _robustRandom;

View File

@@ -10,7 +10,6 @@ namespace Content.Shared.GameObjects.Components.Cargo
{ {
public sealed override string Name => "CargoOrderDatabase"; public sealed override string Name => "CargoOrderDatabase";
public sealed override uint? NetID => ContentNetIDs.CARGO_ORDER_DATABASE; public sealed override uint? NetID => ContentNetIDs.CARGO_ORDER_DATABASE;
public sealed override Type StateType => typeof(CargoOrderDatabaseState);
} }
[NetSerializable, Serializable] [NetSerializable, Serializable]

View File

@@ -13,7 +13,6 @@ namespace Content.Shared.GameObjects.Components.Cargo
{ {
public sealed override string Name => "GalacticMarket"; public sealed override string Name => "GalacticMarket";
public sealed override uint? NetID => ContentNetIDs.GALACTIC_MARKET; public sealed override uint? NetID => ContentNetIDs.GALACTIC_MARKET;
public sealed override Type StateType => typeof(GalacticMarketState);
protected List<CargoProductPrototype> _products = new List<CargoProductPrototype>(); protected List<CargoProductPrototype> _products = new List<CargoProductPrototype>();

View File

@@ -66,9 +66,6 @@ namespace Content.Shared.GameObjects.Components.Chemistry
/// <inheritdoc /> /// <inheritdoc />
public sealed override uint? NetID => ContentNetIDs.SOLUTION; public sealed override uint? NetID => ContentNetIDs.SOLUTION;
/// <inheritdoc />
public sealed override Type StateType => typeof(SolutionComponentState);
/// <inheritdoc /> /// <inheritdoc />
public override void ExposeData(ObjectSerializer serializer) public override void ExposeData(ObjectSerializer serializer)
{ {

View File

@@ -9,7 +9,6 @@ namespace Content.Shared.GameObjects
{ {
public override string Name => "Damageable"; public override string Name => "Damageable";
public sealed override uint? NetID => ContentNetIDs.DAMAGEABLE; public sealed override uint? NetID => ContentNetIDs.DAMAGEABLE;
public sealed override Type StateType => typeof(DamageComponentState);
} }
// The IDs of the items get synced over the network. // The IDs of the items get synced over the network.

View File

@@ -19,7 +19,6 @@ namespace Content.Shared.GameObjects
public sealed override string Name => "Inventory"; public sealed override string Name => "Inventory";
public sealed override uint? NetID => ContentNetIDs.STORAGE; public sealed override uint? NetID => ContentNetIDs.STORAGE;
public sealed override Type StateType => typeof(InventoryComponentState);
[ViewVariables] [ViewVariables]
protected Inventory InventoryInstance { get; private set; } protected Inventory InventoryInstance { get; private set; }

View File

@@ -12,7 +12,6 @@ namespace Content.Shared.GameObjects.Components.Items
public sealed class ItemCooldownComponent : Component public sealed class ItemCooldownComponent : Component
{ {
public override string Name => "ItemCooldown"; public override string Name => "ItemCooldown";
public override Type StateType => typeof(ItemCooldownComponentState);
public override uint? NetID => ContentNetIDs.ITEMCOOLDOWN; public override uint? NetID => ContentNetIDs.ITEMCOOLDOWN;
private TimeSpan? _cooldownEnd; private TimeSpan? _cooldownEnd;

View File

@@ -9,7 +9,6 @@ namespace Content.Shared.GameObjects
{ {
public sealed override string Name => "Hands"; public sealed override string Name => "Hands";
public sealed override uint? NetID => ContentNetIDs.HANDS; public sealed override uint? NetID => ContentNetIDs.HANDS;
public sealed override Type StateType => typeof(HandsComponentState);
} }
// The IDs of the items get synced over the network. // The IDs of the items get synced over the network.

View File

@@ -8,7 +8,6 @@ namespace Content.Shared.GameObjects.Components.Mobs
{ {
public sealed override uint? NetID => ContentNetIDs.COMBATMODE; public sealed override uint? NetID => ContentNetIDs.COMBATMODE;
public override string Name => "CombatMode"; public override string Name => "CombatMode";
public sealed override Type StateType => typeof(CombatModeComponentState);
[Serializable, NetSerializable] [Serializable, NetSerializable]
protected sealed class CombatModeComponentState : ComponentState protected sealed class CombatModeComponentState : ComponentState

View File

@@ -13,7 +13,6 @@ namespace Content.Shared.GameObjects.Components.Mobs
public sealed override string Name => "HumanoidAppearance"; public sealed override string Name => "HumanoidAppearance";
public sealed override uint? NetID => ContentNetIDs.HUMANOID_APPEARANCE; public sealed override uint? NetID => ContentNetIDs.HUMANOID_APPEARANCE;
public sealed override Type StateType => typeof(HumanoidAppearanceComponentState);
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
public virtual HumanoidCharacterAppearance Appearance public virtual HumanoidCharacterAppearance Appearance

View File

@@ -11,7 +11,6 @@ namespace Content.Shared.GameObjects.Components.Mobs
{ {
public override string Name => "OverlayEffectsUI"; public override string Name => "OverlayEffectsUI";
public sealed override uint? NetID => ContentNetIDs.OVERLAYEFFECTS; public sealed override uint? NetID => ContentNetIDs.OVERLAYEFFECTS;
public sealed override Type StateType => typeof(OverlayEffectComponentState);
} }
public enum ScreenEffects public enum ScreenEffects

View File

@@ -13,8 +13,6 @@ namespace Content.Shared.GameObjects.Components.Mobs
{ {
public override string Name => "StatusEffectsUI"; public override string Name => "StatusEffectsUI";
public override uint? NetID => ContentNetIDs.STATUSEFFECTS; public override uint? NetID => ContentNetIDs.STATUSEFFECTS;
public sealed override Type StateType => typeof(StatusEffectComponentState);
} }
[Serializable, NetSerializable] [Serializable, NetSerializable]

View File

@@ -13,7 +13,6 @@ namespace Content.Shared.GameObjects.Components.Research
{ {
public override string Name => "LatheDatabase"; public override string Name => "LatheDatabase";
public override uint? NetID => ContentNetIDs.LATHE_DATABASE; public override uint? NetID => ContentNetIDs.LATHE_DATABASE;
public override Type StateType => typeof(LatheDatabaseState);
private List<LatheRecipePrototype> _recipes = new List<LatheRecipePrototype>(); private List<LatheRecipePrototype> _recipes = new List<LatheRecipePrototype>();

View File

@@ -14,7 +14,6 @@ namespace Content.Shared.GameObjects.Components.Research
protected virtual Dictionary<string, int> Storage { get; set; } protected virtual Dictionary<string, int> Storage { get; set; }
public override string Name => "MaterialStorage"; public override string Name => "MaterialStorage";
public sealed override uint? NetID => ContentNetIDs.MATERIAL_STORAGE; public sealed override uint? NetID => ContentNetIDs.MATERIAL_STORAGE;
public sealed override Type StateType => typeof(MaterialStorageState);
public int this[string ID] public int this[string ID]
{ {

View File

@@ -14,7 +14,6 @@ namespace Content.Shared.GameObjects.Components.Research
{ {
public override string Name => "ProtolatheDatabase"; public override string Name => "ProtolatheDatabase";
public sealed override uint? NetID => ContentNetIDs.PROTOLATHE_DATABASE; public sealed override uint? NetID => ContentNetIDs.PROTOLATHE_DATABASE;
public sealed override Type StateType => typeof(ProtolatheDatabaseState);
private List<LatheRecipePrototype> _protolatheRecipes = new List<LatheRecipePrototype>(); private List<LatheRecipePrototype> _protolatheRecipes = new List<LatheRecipePrototype>();

View File

@@ -13,7 +13,6 @@ namespace Content.Shared.GameObjects.Components.Research
{ {
public override string Name => "TechnologyDatabase"; public override string Name => "TechnologyDatabase";
public override uint? NetID => ContentNetIDs.TECHNOLOGY_DATABASE; public override uint? NetID => ContentNetIDs.TECHNOLOGY_DATABASE;
public override Type StateType => typeof(TechnologyDatabaseState);
protected List<TechnologyPrototype> _technologies = new List<TechnologyPrototype>(); protected List<TechnologyPrototype> _technologies = new List<TechnologyPrototype>();

View File

@@ -8,7 +8,6 @@ namespace Content.Shared.GameObjects.Components
{ {
public sealed override string Name => "HandheldLight"; public sealed override string Name => "HandheldLight";
public sealed override uint? NetID => ContentNetIDs.HANDHELD_LIGHT; public sealed override uint? NetID => ContentNetIDs.HANDHELD_LIGHT;
public sealed override Type StateType => typeof(HandheldLightComponentState);
[Serializable, NetSerializable] [Serializable, NetSerializable]
protected sealed class HandheldLightComponentState : ComponentState protected sealed class HandheldLightComponentState : ComponentState

View File

@@ -8,7 +8,6 @@ namespace Content.Shared.GameObjects.Components
{ {
public sealed override string Name => "Stack"; public sealed override string Name => "Stack";
public sealed override uint? NetID => ContentNetIDs.STACK; public sealed override uint? NetID => ContentNetIDs.STACK;
public sealed override Type StateType => typeof(StackComponentState);
[Serializable, NetSerializable] [Serializable, NetSerializable]
protected sealed class StackComponentState : ComponentState protected sealed class StackComponentState : ComponentState