Use automatic component registration.

This commit is contained in:
Pieter-Jan Briers
2019-07-31 15:02:36 +02:00
parent a90d7a645c
commit ceb8cc8421
94 changed files with 353 additions and 540 deletions

View File

@@ -1,29 +1,15 @@
using System;
using Content.Client.Chat;
using Content.Client.GameObjects;
using Content.Client.GameObjects.Components;
using Content.Client.GameObjects.Components.Actor;
using Content.Client.GameObjects.Components.Clothing;
using Content.Client.GameObjects.Components.Construction;
using Content.Client.GameObjects.Components.IconSmoothing;
using Content.Client.GameObjects.Components.Mobs;
using Content.Client.GameObjects.Components.Power;
using Content.Client.GameObjects.Components.Research;
using Content.Client.GameObjects.Components.Sound;
using Content.Client.GameObjects.Components.Storage;
using Content.Client.GameObjects.Components.Weapons.Ranged;
using Content.Client.GameTicking;
using Content.Client.Input;
using Content.Client.Interfaces;
using Content.Client.Interfaces.Chat;
using Content.Client.Interfaces.GameObjects;
using Content.Client.Interfaces.Parallax;
using Content.Client.Parallax;
using Content.Client.UserInterface;
using Content.Shared.GameObjects.Components.Chemistry;
using Content.Shared.GameObjects.Components.Markers;
using Content.Shared.GameObjects.Components.Materials;
using Content.Shared.GameObjects.Components.Mobs;
using Content.Shared.GameObjects.Components.Research;
using Content.Shared.Interfaces;
using Robust.Client;
@@ -51,115 +37,74 @@ namespace Content.Client
var factory = IoCManager.Resolve<IComponentFactory>();
var prototypes = IoCManager.Resolve<IPrototypeManager>();
factory.RegisterIgnore("Interactable");
factory.RegisterIgnore("Destructible");
factory.RegisterIgnore("Temperature");
factory.RegisterIgnore("PowerTransfer");
factory.RegisterIgnore("PowerNode");
factory.RegisterIgnore("PowerProvider");
factory.RegisterIgnore("PowerDevice");
factory.RegisterIgnore("PowerStorage");
factory.RegisterIgnore("PowerGenerator");
factory.DoAutoRegistrations();
factory.RegisterIgnore("Explosive");
factory.RegisterIgnore("OnUseTimerTrigger");
var registerIgnore = new[]
{
"Interactable",
"Destructible",
"Temperature",
"PowerTransfer",
"PowerNode",
"PowerProvider",
"PowerDevice",
"PowerStorage",
"PowerGenerator",
"Explosive",
"OnUseTimerTrigger",
"ToolboxElectricalFill",
"ToolLockerFill",
"EmitSoundOnUse",
"FootstepModifier",
"HeatResistance",
"CombatMode",
"Teleportable",
"ItemTeleporter",
"Portal",
"EntityStorage",
"PlaceableSurface",
"Wirecutter",
"Screwdriver",
"Multitool",
"Welder",
"Wrench",
"Crowbar",
"HitscanWeapon",
"ProjectileWeapon",
"Projectile",
"MeleeWeapon",
"Storeable",
"Stack",
"Dice",
"Construction",
"Apc",
"Door",
"PoweredLight",
"Smes",
"Powercell",
"HandheldLight",
"LightBulb",
"Healing",
"Catwalk",
"BallisticMagazine",
"BallisticMagazineWeapon",
"BallisticBullet",
"HitscanWeaponCapacitor",
"PowerCell",
"AiController",
"PlayerInputMover",
};
factory.RegisterIgnore("ToolboxElectricalFill");
factory.RegisterIgnore("ToolLockerFill");
factory.RegisterIgnore("EmitSoundOnUse");
factory.RegisterIgnore("FootstepModifier");
factory.RegisterIgnore("HeatResistance");
factory.RegisterIgnore("CombatMode");
factory.RegisterIgnore("Teleportable");
factory.RegisterIgnore("ItemTeleporter");
factory.RegisterIgnore("Portal");
factory.RegisterIgnore("EntityStorage");
factory.RegisterIgnore("PlaceableSurface");
factory.RegisterIgnore("Wirecutter");
factory.RegisterIgnore("Screwdriver");
factory.RegisterIgnore("Multitool");
factory.RegisterIgnore("Welder");
factory.RegisterIgnore("Wrench");
factory.RegisterIgnore("Crowbar");
factory.Register<ClientRangedWeaponComponent>();
factory.RegisterIgnore("HitscanWeapon");
factory.RegisterIgnore("ProjectileWeapon");
factory.RegisterIgnore("Projectile");
factory.RegisterIgnore("MeleeWeapon");
factory.RegisterIgnore("Storeable");
factory.RegisterIgnore("Stack");
factory.RegisterIgnore("Dice");
factory.Register<HandsComponent>();
factory.RegisterReference<HandsComponent, IHandsComponent>();
factory.Register<ClientStorageComponent>();
factory.Register<ClientInventoryComponent>();
factory.Register<PowerDebugTool>();
factory.Register<ConstructorComponent>();
factory.Register<ConstructionGhostComponent>();
factory.Register<IconSmoothComponent>();
factory.Register<LowWallComponent>();
factory.RegisterReference<LowWallComponent, IconSmoothComponent>();
factory.Register<DamageableComponent>();
factory.Register<ClothingComponent>();
factory.Register<ItemComponent>();
factory.Register<MaterialComponent>();
factory.Register<SolutionComponent>();
factory.Register<SoundComponent>();
factory.Register<MaterialStorageComponent>();
factory.RegisterReference<MaterialStorageComponent, SharedMaterialStorageComponent>();
factory.RegisterReference<ClothingComponent, ItemComponent>();
factory.Register<SpeciesUI>();
factory.Register<CharacterInterface>();
factory.RegisterIgnore("Construction");
factory.RegisterIgnore("Apc");
factory.RegisterIgnore("Door");
factory.RegisterIgnore("PoweredLight");
factory.RegisterIgnore("Smes");
factory.RegisterIgnore("Powercell");
factory.RegisterIgnore("HandheldLight");
factory.RegisterIgnore("LightBulb");
factory.RegisterIgnore("Healing");
factory.RegisterIgnore("Catwalk");
factory.RegisterIgnore("BallisticMagazine");
factory.RegisterIgnore("BallisticMagazineWeapon");
factory.RegisterIgnore("BallisticBullet");
factory.RegisterIgnore("HitscanWeaponCapacitor");
prototypes.RegisterIgnore("material");
factory.RegisterIgnore("PowerCell");
factory.Register<SharedSpawnPointComponent>();
foreach (var ignoreName in registerIgnore)
{
factory.RegisterIgnore(ignoreName);
}
factory.Register<SharedLatheComponent>();
factory.Register<LatheDatabaseComponent>();
factory.Register<SharedSpawnPointComponent>();
factory.Register<SolutionComponent>();
factory.RegisterReference<LatheDatabaseComponent, SharedLatheDatabaseComponent>();
factory.Register<CameraRecoilComponent>();
factory.RegisterReference<CameraRecoilComponent, SharedCameraRecoilComponent>();
factory.Register<SubFloorHideComponent>();
factory.RegisterIgnore("AiController");
factory.RegisterIgnore("PlayerInputMover");
factory.Register<ExaminerComponent>();
factory.Register<CharacterInfoComponent>();
factory.Register<WindowComponent>();
prototypes.RegisterIgnore("material");
IoCManager.Register<IGameHud, GameHud>();
IoCManager.Register<IClientNotifyManager, ClientNotifyManager>();
@@ -188,6 +133,7 @@ namespace Content.Client
_escapeMenuOwner.Initialize();
}
/// <summary>
/// Subscribe events to the player manager after the player manager is set up
/// </summary>

View File

@@ -10,6 +10,7 @@ using Robust.Shared.Localization;
namespace Content.Client.GameObjects.Components.Actor
{
[RegisterComponent]
public sealed class CharacterInfoComponent : Component, ICharacterUI
{
private CharacterInfoControl _control;

View File

@@ -18,6 +18,7 @@ namespace Content.Client.GameObjects.Components.Actor
/// A semi-abstract component which gets added to entities upon attachment and collects all character
/// user interfaces into a single window and keybind for the user
/// </summary>
[RegisterComponent]
public class CharacterInterface : Component
{
public override string Name => "Character Interface Component";

View File

@@ -1,13 +1,15 @@
using Content.Shared.GameObjects;
using System;
using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Inventory;
using Content.Shared.GameObjects.Components.Items;
using Robust.Client.Graphics;
using Robust.Shared.GameObjects;
using Robust.Shared.ViewVariables;
using System;
namespace Content.Client.GameObjects.Components.Clothing
{
[RegisterComponent]
[ComponentReference(typeof(ItemComponent))]
public class ClothingComponent : ItemComponent
{
public override string Name => "Clothing";

View File

@@ -6,6 +6,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Client.GameObjects.Components.Construction
{
[RegisterComponent]
public class ConstructionGhostComponent : Component
{
public override string Name => "ConstructionGhost";

View File

@@ -15,6 +15,7 @@ using Robust.Shared.Maths;
namespace Content.Client.GameObjects.Components.Construction
{
[RegisterComponent]
public class ConstructorComponent : SharedConstructorComponent
{
#pragma warning disable 649

View File

@@ -1,6 +1,6 @@
using Content.Shared.GameObjects;
using System.Collections.Generic;
using Content.Shared.GameObjects;
using Robust.Shared.GameObjects;
using System.Collections.Generic;
namespace Content.Client.GameObjects
{
@@ -8,6 +8,7 @@ namespace Content.Client.GameObjects
/// Fuck I really hate doing this
/// TODO: make sure the client only gets damageable component on the clientside entity for its player mob
/// </summary>
[RegisterComponent]
public class DamageableComponent : SharedDamageableComponent
{
/// <inheritdoc />

View File

@@ -18,6 +18,7 @@ namespace Content.Client.GameObjects
/// <summary>
/// A character UI which shows items the user has equipped within his inventory
/// </summary>
[RegisterComponent]
public class ClientInventoryComponent : SharedInventoryComponent
{
private readonly Dictionary<Slots, IEntity> _slots = new Dictionary<Slots, IEntity>();

View File

@@ -25,6 +25,7 @@ namespace Content.Client.GameObjects.Components.IconSmoothing
/// To use, set <c>base</c> equal to the prefix of the corner states in the sprite base RSI.
/// Any objects with the same <c>key</c> will connect.
/// </remarks>
[RegisterComponent]
public class IconSmoothComponent : Component
{
private string _smoothKey;

View File

@@ -15,6 +15,8 @@ using Robust.Shared.ViewVariables;
namespace Content.Client.GameObjects
{
[RegisterComponent]
[ComponentReference(typeof(IHandsComponent))]
public class HandsComponent : SharedHandsComponent, IHandsComponent
{
private HandsGui _gui;

View File

@@ -1,4 +1,5 @@
using Content.Shared.GameObjects;
using System;
using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Items;
using Robust.Client.Graphics;
using Robust.Client.Interfaces.ResourceManagement;
@@ -9,10 +10,10 @@ using Robust.Shared.IoC;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
using System;
namespace Content.Client.GameObjects
{
[RegisterComponent]
public class ItemComponent : Component
{
public override string Name => "Item";

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Content.Client.GameObjects.Components.IconSmoothing;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Maths;
using static Robust.Client.GameObjects.SpriteComponent;
@@ -14,6 +15,8 @@ namespace Content.Client.GameObjects.Components
/// <summary>
/// Override of icon smoothing to handle the specific complexities of low walls.
/// </summary>
[RegisterComponent]
[ComponentReference(typeof(IconSmoothComponent))]
public class LowWallComponent : IconSmoothComponent
{
public override string Name => "LowWall";

View File

@@ -8,6 +8,8 @@ using Robust.Shared.Maths;
namespace Content.Client.GameObjects.Components.Mobs
{
[RegisterComponent]
[ComponentReference(typeof(SharedCameraRecoilComponent))]
public sealed class CameraRecoilComponent : SharedCameraRecoilComponent
{
// Maximum rate of magnitude restore towards 0 kick.

View File

@@ -1,31 +1,31 @@
using Content.Client.GameObjects.Components.Actor;
using Content.Client.GameObjects.Components.Mobs;
using System.Collections.Generic;
using Content.Client.GameObjects.Components.Actor;
using Content.Client.Graphics.Overlays;
using Content.Client.UserInterface;
using Content.Client.Utility;
using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Mobs;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Graphics.Overlays;
using Robust.Client.Interfaces.Graphics.Overlays;
using Robust.Client.Interfaces.ResourceManagement;
using Robust.Client.Interfaces.UserInterface;
using Robust.Client.Player;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components.Renderable;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.IoC;
using System.Collections.Generic;
using Content.Client.UserInterface;
using Content.Client.Utility;
using Content.Shared.GameObjects.Components.Mobs;
using Robust.Client.Graphics;
using Robust.Client.Graphics.Overlays;
using Robust.Client.Interfaces.UserInterface;
using Robust.Shared.GameObjects.Components.Renderable;
namespace Content.Client.GameObjects
{
/// <summary>
/// A character UI component which shows the current damage state of the mob (living/dead)
/// </summary>
[RegisterComponent]
public class SpeciesUI : SharedSpeciesComponent//, ICharacterUI
{
private StatusEffectsUI _ui;

View File

@@ -1,14 +1,13 @@
using Content.Shared.GameObjects.Components.Power;
using Robust.Client.Interfaces.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.IoC;
namespace Content.Client.GameObjects.Components.Power
{
[RegisterComponent]
public class PowerDebugTool : SharedPowerDebugTool
{
SS14Window LastWindow;

View File

@@ -1,13 +1,13 @@
using Content.Shared.GameObjects.Components.Research;
using Content.Shared.Research;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
namespace Content.Client.GameObjects.Components.Research
{
[RegisterComponent]
[ComponentReference(typeof(SharedLatheDatabaseComponent))]
public class LatheDatabaseComponent : SharedLatheDatabaseComponent
{
#pragma warning disable CS0649

View File

@@ -2,11 +2,11 @@ using System;
using System.Collections.Generic;
using Content.Shared.GameObjects.Components.Research;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Network;
namespace Content.Client.GameObjects.Components.Research
{
[RegisterComponent]
[ComponentReference(typeof(SharedMaterialStorageComponent))]
public class MaterialStorageComponent : SharedMaterialStorageComponent
{
protected override Dictionary<string, int> Storage { get; set; } = new Dictionary<string, int>();

View File

@@ -5,14 +5,13 @@ using Robust.Client.GameObjects.EntitySystems;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.Interfaces.Timers;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Serialization;
using Robust.Shared.Timers;
namespace Content.Client.GameObjects.Components.Sound
{
[RegisterComponent]
public class SoundComponent : SharedSoundComponent
{
private readonly List<ScheduledSound> _schedules = new List<ScheduledSound>();

View File

@@ -17,6 +17,7 @@ namespace Content.Client.GameObjects.Components.Storage
/// <summary>
/// Client version of item storage containers, contains a UI which displays stored entities and their size
/// </summary>
[RegisterComponent]
public class ClientStorageComponent : SharedStorageComponent
{
private Dictionary<EntityUid, int> StoredEntities { get; set; } = new Dictionary<EntityUid, int>();

View File

@@ -10,6 +10,7 @@ namespace Content.Client.GameObjects.Components
/// is not a sub floor (plating).
/// </summary>
/// <seealso cref="ContentTileDefinition.IsSubFloor"/>
[RegisterComponent]
public sealed class SubFloorHideComponent : Component
{
private SnapGridComponent _snapGridComponent;

View File

@@ -1,12 +1,13 @@
using System;
using Content.Shared.GameObjects.Components.Weapons.Ranged;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Map;
namespace Content.Client.GameObjects.Components.Weapons.Ranged
{
[RegisterComponent]
public sealed class ClientRangedWeaponComponent : SharedRangedWeaponComponent
{
private TimeSpan _lastFireTime;

View File

@@ -8,6 +8,7 @@ using static Content.Client.GameObjects.Components.IconSmoothing.IconSmoothCompo
namespace Content.Client.GameObjects.Components
{
[RegisterComponent]
public sealed class WindowComponent : Component
{
public override string Name => "Window";

View File

@@ -1,73 +1,22 @@
using Content.Server.Chat;
using Content.Server.GameObjects;
using Content.Server.GameObjects.Components;
using Content.Server.GameObjects.Components.Power;
using Content.Server.GameObjects.Components.Interactable.Tools;
using Content.Server.Interfaces.GameObjects;
using Content.Server.Placement;
using Robust.Server;
using Robust.Server.Interfaces;
using Robust.Server.Interfaces.Maps;
using Robust.Server.Interfaces.Player;
using Robust.Server.Player;
using Robust.Shared.Console;
using Robust.Shared.ContentPack;
using Robust.Shared.Enums;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.Interfaces.Timers;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Timers;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.Maths;
using Content.Server.GameObjects.Components.Weapon.Ranged.Hitscan;
using Content.Server.GameObjects.Components.Weapon.Ranged.Projectile;
using Content.Server.GameObjects.Components.Projectiles;
using Content.Server.GameObjects.Components.Weapon.Melee;
using Content.Server.GameObjects.Components.Stack;
using Content.Server.GameObjects.Components.Construction;
using Content.Server.GameObjects.Components.Mobs;
using Content.Server.GameObjects.EntitySystems;
using Content.Server.Mobs;
using Content.Server.Players;
using Content.Server.GameObjects.Components.Interactable;
using Content.Server.GameObjects.Components.Markers;
using Content.Server.GameObjects.Components.Sound;
using Content.Server.GameObjects.Components.Weapon.Ranged;
using Content.Server.GameTicking;
using Content.Server.Interfaces;
using Content.Server.Interfaces.GameTicking;
using Content.Shared.GameObjects.Components.Chemistry;
using Content.Shared.GameObjects.Components.Materials;
using Content.Shared.GameObjects.Components.Inventory;
using Content.Shared.GameObjects.Components.Markers;
using Content.Shared.GameObjects.Components.Mobs;
using Content.Shared.Interfaces;
using Robust.Server.Interfaces.ServerStatus;
using Robust.Shared.Timing;
using Content.Server.GameObjects.Components.Destructible;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.Components.Items.Storage.Fill;
using Content.Server.GameObjects.Components.Movement;
using Content.Server.Interfaces.Chat;
using Content.Server.Interfaces.GameObjects.Components.Movement;
using Content.Server.GameObjects.Components.Research;
using Content.Shared.GameObjects.Components.Research;
using Content.Server.Interfaces.GameTicking;
using Content.Shared.Interfaces;
using Robust.Server.Interfaces.Player;
using Robust.Shared.ContentPack;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Log;
using Content.Server.GameObjects.Components.Explosive;
using Content.Server.GameObjects.Components.Items;
using Content.Server.GameObjects.Components.Triggers;
using Content.Shared.GameObjects.Components.Movement;
using SolutionComponent = Content.Server.GameObjects.Components.Chemistry.SolutionComponent;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Timing;
namespace Content.Server
{
public class EntryPoint : GameServer
{
private IGameTicker _gameTicker;
private IMoMMILink _mommiLink;
private StatusShell _statusShell;
/// <inheritdoc />
@@ -77,129 +26,19 @@ namespace Content.Server
var factory = IoCManager.Resolve<IComponentFactory>();
factory.Register<HandsComponent>();
factory.RegisterReference<HandsComponent, IHandsComponent>();
factory.DoAutoRegistrations();
factory.Register<InventoryComponent>();
var registerIgnore = new[]
{
"ConstructionGhost",
"IconSmooth",
"SubFloorHide"
};
factory.Register<StoreableComponent>();
factory.Register<ItemComponent>();
factory.RegisterReference<ItemComponent, StoreableComponent>();
factory.Register<ClothingComponent>();
factory.RegisterReference<ClothingComponent, ItemComponent>();
factory.RegisterReference<ClothingComponent, StoreableComponent>();
factory.Register<PlaceableSurfaceComponent>();
factory.Register<DamageableComponent>();
factory.Register<DestructibleComponent>();
factory.Register<TemperatureComponent>();
factory.Register<ServerDoorComponent>();
factory.RegisterReference<ServerDoorComponent, IActivate>();
factory.Register<Content.Server.GameObjects.Components.Chemistry.SolutionComponent>();
//Power Components
factory.Register<PowerTransferComponent>();
factory.Register<PowerProviderComponent>();
factory.RegisterReference<PowerProviderComponent, PowerDeviceComponent>();
factory.Register<PowerNodeComponent>();
factory.Register<PowerStorageNetComponent>();
factory.RegisterReference<PowerStorageNetComponent, PowerStorageComponent>();
factory.Register<PowerCellComponent>();
factory.RegisterReference<PowerCellComponent, PowerStorageComponent>();
factory.Register<PowerDeviceComponent>();
factory.Register<PowerGeneratorComponent>();
factory.Register<LightBulbComponent>();
//Tools
factory.Register<MultitoolComponent>();
factory.Register<WirecutterComponent>();
factory.Register<WrenchComponent>();
factory.Register<WelderComponent>();
factory.Register<ScrewdriverComponent>();
factory.Register<CrowbarComponent>();
factory.Register<HitscanWeaponComponent>();
factory.Register<RangedWeaponComponent>();
factory.Register<BallisticMagazineWeaponComponent>();
factory.Register<ProjectileComponent>();
factory.Register<ThrownItemComponent>();
factory.Register<MeleeWeaponComponent>();
factory.Register<HealingComponent>();
factory.Register<SoundComponent>();
factory.Register<HandheldLightComponent>();
factory.Register<ServerStorageComponent>();
factory.RegisterReference<ServerStorageComponent, IStorageComponent>();
factory.RegisterReference<ServerStorageComponent, IActivate>();
factory.Register<EntityStorageComponent>();
factory.RegisterReference<EntityStorageComponent, IStorageComponent>();
factory.RegisterReference<EntityStorageComponent, IActivate>();
factory.Register<ToolLockerFillComponent>();
factory.Register<ToolboxElectricalFillComponent>();
factory.Register<PowerDebugTool>();
factory.Register<PoweredLightComponent>();
factory.Register<SmesComponent>();
factory.Register<ApcComponent>();
factory.RegisterReference<ApcComponent, IActivate>();
factory.Register<MaterialComponent>();
factory.Register<StackComponent>();
factory.Register<MaterialStorageComponent>();
factory.RegisterReference<MaterialStorageComponent, SharedMaterialStorageComponent>();
factory.Register<ConstructionComponent>();
factory.Register<ConstructorComponent>();
factory.RegisterIgnore("ConstructionGhost");
factory.Register<MindComponent>();
factory.Register<SpeciesComponent>();
factory.Register<HeatResistanceComponent>();
factory.Register<SpawnPointComponent>();
factory.RegisterReference<SpawnPointComponent, SharedSpawnPointComponent>();
factory.Register<LatheComponent>();
factory.RegisterReference<LatheComponent, IActivate>();
factory.Register<LatheDatabaseComponent>();
factory.RegisterReference<LatheDatabaseComponent, SharedLatheDatabaseComponent>();
factory.Register<BallisticBulletComponent>();
factory.Register<BallisticMagazineComponent>();
factory.Register<HitscanWeaponCapacitorComponent>();
factory.Register<CameraRecoilComponent>();
factory.RegisterReference<CameraRecoilComponent, SharedCameraRecoilComponent>();
factory.RegisterIgnore("IconSmooth");
factory.RegisterIgnore("SubFloorHide");
factory.Register<PlayerInputMoverComponent>();
factory.RegisterReference<PlayerInputMoverComponent, IMoverComponent>();
factory.Register<AiControllerComponent>();
factory.Register<ServerPortalComponent>();
factory.Register<ServerTeleporterComponent>();
factory.Register<TeleportableComponent>();
factory.Register<CatwalkComponent>();
factory.Register<DiceComponent>();
factory.Register<ExplosiveComponent>();
factory.Register<OnUseTimerTriggerComponent>();
factory.Register<FootstepModifierComponent>();
factory.Register<EmitSoundOnUseComponent>();
factory.Register<CombatModeComponent>();
factory.Register<ExaminerComponent>();
foreach (var ignoreName in registerIgnore)
{
factory.RegisterIgnore(ignoreName);
}
IoCManager.Register<ISharedNotifyManager, ServerNotifyManager>();
IoCManager.Register<IServerNotifyManager, ServerNotifyManager>();
@@ -218,8 +57,6 @@ namespace Content.Server
IoCManager.Resolve<IServerNotifyManager>().Initialize();
IoCManager.Resolve<IChatManager>().Initialize();
_mommiLink = IoCManager.Resolve<IMoMMILink>();
var playerManager = IoCManager.Resolve<IPlayerManager>();
_statusShell = new StatusShell();

View File

@@ -5,6 +5,7 @@ namespace Content.Server.GameObjects.Components
/// <summary>
/// Literally just a marker component for footsteps for now.
/// </summary>
[RegisterComponent]
public sealed class CatwalkComponent : Component
{
public override string Name => "Catwalk";

View File

@@ -1,6 +1,7 @@
using System;
using Content.Shared.Chemistry;
using Content.Shared.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
namespace Content.Server.GameObjects.Components.Chemistry
@@ -8,6 +9,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
/// <summary>
/// Shared ECS component that manages a liquid solution of reagents.
/// </summary>
[RegisterComponent]
internal class SolutionComponent : Shared.GameObjects.Components.Chemistry.SolutionComponent
{
/// <summary>
@@ -131,7 +133,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
// pulling from an empty container, pointless to continue
if (transferQuantity <= 0)
return;
var transferSolution = component.SplitSolution(transferQuantity);
handSolutionComp.TryAddSolution(transferSolution);
}

View File

@@ -17,6 +17,7 @@ using static Content.Shared.Construction.ConstructionStepTool;
namespace Content.Server.GameObjects.Components.Construction
{
[RegisterComponent]
public class ConstructionComponent : Component, IAttackBy
{
public override string Name => "Construction";

View File

@@ -3,13 +3,11 @@ using Content.Server.GameObjects.Components.Stack;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.Construction;
using Content.Shared.GameObjects.Components.Construction;
using Robust.Server.GameObjects;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.IoC;
using Robust.Shared.Map;
@@ -18,6 +16,7 @@ using Robust.Shared.Prototypes;
namespace Content.Server.GameObjects.Components.Construction
{
[RegisterComponent]
public class ConstructorComponent : SharedConstructorComponent
{
#pragma warning disable 649

View File

@@ -1,12 +1,9 @@
using Content.Server.Interfaces.GameObjects;
using System;
using System;
using System.Collections.Generic;
using Robust.Shared.Maths;
using Robust.Shared.GameObjects;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;
using Content.Server.Interfaces;
using Content.Server.Interfaces.GameObjects;
using Content.Shared.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
@@ -18,6 +15,7 @@ namespace Content.Server.GameObjects
/// A component that handles receiving damage and healing,
/// as well as informing other components of it.
/// </summary>
[RegisterComponent]
public class DamageableComponent : SharedDamageableComponent, IDamageableComponent
{
/// <inheritdoc />

View File

@@ -1,21 +1,21 @@
using System;
using System.Collections.Generic;
using Content.Server.GameObjects.EntitySystems;
using Content.Server.Interfaces;
using Content.Shared.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Maths;
using Content.Server.Interfaces;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Destructible
{
/// <summary>
/// Deletes the entity once a certain damage threshold has been reached.
/// </summary>
[RegisterComponent]
public class DestructibleComponent : Component, IOnDamageBehavior, IDestroyAct, IExAct
{
#pragma warning disable 649
@@ -63,7 +63,7 @@ namespace Content.Server.GameObjects.Components.Destructible
/// <inheritdoc />
void IOnDamageBehavior.OnDamageThresholdPassed(object obj, DamageThresholdPassedEventArgs e)
{
{
if (e.Passed && e.DamageThreshold == Threshold && destroyed == false)
{
destroyed = true;

View File

@@ -10,6 +10,8 @@ using Robust.Shared.Timers;
namespace Content.Server.GameObjects
{
[RegisterComponent]
[ComponentReference(typeof(IActivate))]
public class ServerDoorComponent : Component, IActivate
{
public override string Name => "Door";

View File

@@ -1,28 +1,27 @@
using System;
using System.Linq;
using System.Collections.Generic;
using Content.Server.GameObjects.Components.Mobs;
using Robust.Server.Interfaces.GameObjects;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.Maps;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.GameObjects.EntitySystemMessages;
using Robust.Server.Interfaces.GameObjects;
using Robust.Server.Interfaces.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.GameObjects.EntitySystemMessages;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects;
using Content.Shared.Maps;
using Robust.Server.Interfaces.Player;
namespace Content.Server.GameObjects.Components.Explosive
{
[RegisterComponent]
public class ExplosiveComponent : Component, ITimerTrigger, IDestroyAct
{
#pragma warning disable 649
#pragma warning disable 649
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager;
[Dependency] private readonly IMapManager _mapManager;
[Dependency] private readonly IServerEntityManager _serverEntityManager;
@@ -66,7 +65,7 @@ namespace Content.Server.GameObjects.Components.Explosive
if (distanceFromEntity < DevastationRange)
{
severity = ExplosionSeverity.Destruction;
}
}
else if (distanceFromEntity < HeavyImpactRange)
{
severity = ExplosionSeverity.Heavy;

View File

@@ -5,8 +5,8 @@ using Content.Shared.GameObjects;
using Robust.Server.GameObjects.Components.Container;
using Robust.Server.Interfaces.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.IoC;
using Robust.Shared.Utility;
@@ -16,6 +16,7 @@ using static Content.Shared.GameObjects.SharedInventoryComponent.ClientInventory
namespace Content.Server.GameObjects
{
[RegisterComponent]
public class InventoryComponent : SharedInventoryComponent
{
[ViewVariables]

View File

@@ -3,16 +3,12 @@ using System.Collections.Generic;
using Content.Server.GameObjects.EntitySystems;
using Content.Server.Interfaces.GameObjects;
using Content.Shared.GameObjects;
using Content.Shared.Input;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Server.GameObjects.Components.Container;
using Robust.Server.GameObjects.EntitySystemMessages;
using Robust.Server.Interfaces.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.Input;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.IoC;
using Robust.Shared.Log;
@@ -24,6 +20,8 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects
{
[RegisterComponent]
[ComponentReference(typeof(IHandsComponent))]
public class HandsComponent : SharedHandsComponent, IHandsComponent
{
#pragma warning disable 649

View File

@@ -1,21 +1,12 @@
using System;
using Content.Server.GameObjects.Components.Stack;
using Robust.Shared.GameObjects;
using Content.Server.GameObjects.Components.Stack;
using Content.Server.GameObjects.EntitySystems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.IoC;
using Robust.Server.GameObjects;
using Robust.Shared.Maths;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.GameObjects.EntitySystemMessages;
using Robust.Shared.Serialization;
using Robust.Shared.Interfaces.GameObjects.Components;
using Content.Shared.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Server.GameObjects.Components.Weapon.Melee
{
[RegisterComponent]
public class HealingComponent : Component, IAfterAttack, IUse
{
public override string Name => "Healing";

View File

@@ -16,6 +16,7 @@ namespace Content.Server.GameObjects.Components.Interactable
/// <summary>
/// Component that represents a handheld lightsource which can be toggled on and off.
/// </summary>
[RegisterComponent]
internal class HandheldLightComponent : Component, IUse, IExamine, IAttackBy, IMapInit
{
public const float Wattage = 10;

View File

@@ -1,6 +1,7 @@
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.Maps;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.IoC;
@@ -8,6 +9,7 @@ using Robust.Shared.Map;
namespace Content.Server.GameObjects.Components.Interactable.Tools
{
[RegisterComponent]
public class CrowbarComponent : ToolComponent, IAfterAttack
{
#pragma warning disable 649

View File

@@ -1,10 +1,13 @@
namespace Content.Server.GameObjects.Components.Interactable.Tools
using Robust.Shared.GameObjects;
namespace Content.Server.GameObjects.Components.Interactable.Tools
{
/// <summary>
/// Tool used for interfacing/hacking into configurable computers
/// </summary>
[RegisterComponent]
public class MultitoolComponent : ToolComponent
{
public override string Name => "Multitool";
}
}
}

View File

@@ -1,5 +1,8 @@
namespace Content.Server.GameObjects.Components.Interactable.Tools
using Robust.Shared.GameObjects;
namespace Content.Server.GameObjects.Components.Interactable.Tools
{
[RegisterComponent]
public class ScrewdriverComponent : ToolComponent
{
/// <summary>
@@ -7,4 +10,4 @@
/// </summary>
public override string Name => "Screwdriver";
}
}
}

View File

@@ -1,12 +1,10 @@
using System;
using System.Text;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;
using Robust.Server.GameObjects;
using Content.Server.GameObjects.EntitySystems;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Interactable.Tools
@@ -14,6 +12,7 @@ namespace Content.Server.GameObjects.Components.Interactable.Tools
/// <summary>
/// Tool used to weld metal together, light things on fire, or melt into constituent parts
/// </summary>
[RegisterComponent]
class WelderComponent : ToolComponent, EntitySystems.IUse, EntitySystems.IExamine
{
SpriteComponent spriteComponent;

View File

@@ -1,10 +1,13 @@
namespace Content.Server.GameObjects.Components.Interactable.Tools
using Robust.Shared.GameObjects;
namespace Content.Server.GameObjects.Components.Interactable.Tools
{
/// <summary>
/// Tool that can be used for some cutting interactions such as wires or hacking
/// </summary>
[RegisterComponent]
public class WirecutterComponent : ToolComponent
{
public override string Name => "Wirecutter";
}
}
}

View File

@@ -1,10 +1,13 @@
namespace Content.Server.GameObjects.Components.Interactable.Tools
using Robust.Shared.GameObjects;
namespace Content.Server.GameObjects.Components.Interactable.Tools
{
/// <summary>
/// Wrenches bolts, and interacts with things that have been bolted
/// </summary>
[RegisterComponent]
public class WrenchComponent : ToolComponent
{
public override string Name => "Wrench";
}
}
}

View File

@@ -1,15 +1,18 @@
using System;
using System.Collections.Generic;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Items;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
using System;
using System.Collections.Generic;
using Content.Server.GameObjects.EntitySystems;
using Robust.Shared.Utility;
using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines;
namespace Content.Server.GameObjects
{
[RegisterComponent]
[ComponentReference(typeof(ItemComponent))]
[ComponentReference(typeof(StoreableComponent))]
public class ClothingComponent : ItemComponent, IUse
{
public override string Name => "Clothing";

View File

@@ -6,7 +6,6 @@ using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
@@ -15,6 +14,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Items
{
[RegisterComponent]
public class DiceComponent : Component, IActivate, IUse, ILand, IExamine
{
#pragma warning disable 649

View File

@@ -1,4 +1,9 @@
using Content.Server.GameObjects.EntitySystems;
using System.Linq;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.Components.Sound;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Storage;
using Robust.Server.GameObjects;
using Robust.Server.GameObjects.Components.Container;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
@@ -7,14 +12,12 @@ using Robust.Shared.Interfaces.Network;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
using System.Linq;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.Components.Sound;
using Content.Shared.GameObjects.Components.Storage;
using Robust.Server.GameObjects;
namespace Content.Server.GameObjects.Components
{
[RegisterComponent]
[ComponentReference(typeof(IActivate))]
[ComponentReference(typeof(IStorageComponent))]
public class EntityStorageComponent : Component, IActivate, IStorageComponent
{
public override string Name => "EntityStorage";

View File

@@ -7,6 +7,7 @@ using Robust.Shared.Maths;
namespace Content.Server.GameObjects.Components.Items.Storage.Fill
{
[RegisterComponent]
internal sealed class ToolLockerFillComponent : Component, IMapInit
{
public override string Name => "ToolLockerFill";

View File

@@ -7,6 +7,7 @@ using Robust.Shared.Maths;
namespace Content.Server.GameObjects.Components.Items.Storage.Fill
{
[RegisterComponent]
internal sealed class ToolboxElectricalFillComponent : Component, IMapInit
{
public override string Name => "ToolboxElectricalFill";

View File

@@ -1,17 +1,18 @@
using Content.Server.Interfaces.GameObjects;
using Robust.Server.Interfaces.GameObjects;
using Content.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using System;
using Content.Server.GameObjects.EntitySystems;
using Robust.Shared.GameObjects;
using System;
using Content.Server.Interfaces.GameObjects;
using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Items;
using Content.Server.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Maths;
namespace Content.Server.GameObjects
{
[RegisterComponent]
[ComponentReference(typeof(StoreableComponent))]
public class ItemComponent : StoreableComponent, IAttackHand
{
public override string Name => "Item";

View File

@@ -1,32 +1,33 @@
using System.Linq;
using System.Collections.Generic;
using System.Linq;
using Content.Server.GameObjects.Components;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Storage;
using Content.Shared.Interfaces;
using Robust.Server.GameObjects;
using Robust.Server.GameObjects.Components.Container;
using Robust.Server.GameObjects.EntitySystemMessages;
using Robust.Server.Interfaces.Player;
using Robust.Server.Player;
using Robust.Shared.Enums;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Serialization;
using System.Collections.Generic;
using Content.Shared.Interfaces;
using Robust.Shared.GameObjects.EntitySystemMessages;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.ViewVariables;
using Content.Server.GameObjects.Components;
using Content.Server.GameObjects.Components.Items.Storage;
using Robust.Server.GameObjects.EntitySystemMessages;
namespace Content.Server.GameObjects
{
/// <summary>
/// Storage component for containing entities within this one, matches a UI on the client which shows stored entities
/// </summary>
[RegisterComponent]
[ComponentReference(typeof(IActivate))]
[ComponentReference(typeof(IStorageComponent))]
public class ServerStorageComponent : SharedStorageComponent, IAttackBy, IUse, IActivate, IStorageComponent, IDestroyAct
{
#pragma warning disable 649
@@ -149,7 +150,7 @@ namespace Content.Server.GameObjects
{
return false;
}
//Check that we can drop the item from our hands first otherwise we obviously cant put it inside
if (CanInsert(hands.GetActiveHand.Owner) && hands.Drop(hands.ActiveIndex))
{

View File

@@ -3,6 +3,7 @@ using Robust.Shared.Serialization;
namespace Content.Server.GameObjects
{
[RegisterComponent]
public class StoreableComponent : Component
{
public override string Name => "Storeable";

View File

@@ -1,4 +1,3 @@
using System;
using Content.Shared.GameObjects.Components.Markers;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
@@ -6,6 +5,8 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Markers
{
[RegisterComponent]
[ComponentReference(typeof(SharedSpawnPointComponent))]
public sealed class SpawnPointComponent : SharedSpawnPointComponent
{
private SpawnPointType _spawnType;

View File

@@ -1,8 +1,11 @@
using Content.Shared.GameObjects.Components.Mobs;
using Robust.Shared.GameObjects;
using Robust.Shared.Maths;
namespace Content.Server.GameObjects.Components.Mobs
{
[RegisterComponent]
[ComponentReference(typeof(SharedCameraRecoilComponent))]
public sealed class CameraRecoilComponent : SharedCameraRecoilComponent
{
public override void Kick(Vector2 recoil)

View File

@@ -8,6 +8,7 @@ namespace Content.Server.GameObjects.Components.Mobs
/// This is used to differentiate between regular item interactions or
/// using *everything* as a weapon.
/// </summary>
[RegisterComponent]
public sealed class CombatModeComponent : Component
{
public override string Name => "CombatMode";

View File

@@ -1,9 +1,10 @@
using System;
using Robust.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Inventory;
using Robust.Shared.GameObjects;
namespace Content.Server.GameObjects
{
[RegisterComponent]
public class HeatResistanceComponent : Component
{
public override string Name => "HeatResistance";

View File

@@ -1,14 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Content.Server.Mobs;
using Robust.Server.GameObjects;
using Content.Server.Mobs;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.Log;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Mobs
@@ -16,6 +8,7 @@ namespace Content.Server.GameObjects.Components.Mobs
/// <summary>
/// Stores a <see cref="Server.Mobs.Mind"/> on a mob.
/// </summary>
[RegisterComponent]
public class MindComponent : Component
{
/// <inheritdoc />

View File

@@ -12,6 +12,7 @@ using Robust.Shared.Serialization;
namespace Content.Server.GameObjects
{
[RegisterComponent]
public class SpeciesComponent : SharedSpeciesComponent, IActionBlocker, IOnDamageBehavior, IExAct
{
/// <summary>

View File

@@ -5,6 +5,7 @@ using Robust.Shared.Serialization;
namespace Content.Server.GameObjects.Components.Movement
{
[RegisterComponent]
public class AiControllerComponent : Component, IMoverComponent
{
private string _logicName;

View File

@@ -12,6 +12,8 @@ namespace Content.Server.GameObjects.Components.Movement
/// <summary>
/// Moves the entity based on input from a KeyBindingInputComponent.
/// </summary>
[RegisterComponent]
[ComponentReference(typeof(IMoverComponent))]
public class PlayerInputMoverComponent : Component, IMoverComponent
{
private bool _movingUp;

View File

@@ -4,6 +4,7 @@ using Content.Shared.GameObjects.Components.Movement;
using Robust.Server.GameObjects;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization;
@@ -12,6 +13,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Movement
{
[RegisterComponent]
public class ServerPortalComponent : SharedPortalComponent
{
#pragma warning disable 649

View File

@@ -9,7 +9,6 @@ using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
@@ -19,6 +18,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Movement
{
[RegisterComponent]
public class ServerTeleporterComponent : Component, IAfterAttack
{
#pragma warning disable 649

View File

@@ -1,8 +1,8 @@
using Robust.Shared.GameObjects;
using Robust.Shared.Log;
namespace Content.Server.GameObjects.Components.Movement
{
[RegisterComponent]
public class TeleportableComponent : Component
{
public override string Name => "Teleportable";

View File

@@ -4,6 +4,7 @@ using Robust.Shared.Serialization;
namespace Content.Server.GameObjects.Components
{
[RegisterComponent]
public class PlaceableSurfaceComponent : Component, IAttackBy
{
public override string Name => "PlaceableSurface";

View File

@@ -3,15 +3,15 @@ using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Power;
using Robust.Server.GameObjects;
using Robust.Server.GameObjects.Components.UserInterface;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components.UserInterface;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.GameObjects.Components.Power
{
[RegisterComponent]
[ComponentReference(typeof(IActivate))]
public sealed class ApcComponent : SharedApcComponent, IActivate
{
PowerStorageComponent Storage;

View File

@@ -1,9 +1,9 @@
using System;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
using SpriteComponent = Robust.Server.GameObjects.SpriteComponent;
namespace Content.Server.GameObjects.Components.Power
{
@@ -23,6 +23,7 @@ namespace Content.Server.GameObjects.Components.Power
/// <summary>
/// Component that represents a light bulb. Can be broken, or burned, which turns them mostly useless.
/// </summary>
[RegisterComponent]
public class LightBulbComponent : Component
{

View File

@@ -1,8 +1,11 @@
using Content.Shared.GameObjects.Components.Power;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
namespace Content.Server.GameObjects.Components.Power
{
[RegisterComponent]
[ComponentReference(typeof(PowerStorageComponent))]
public class PowerCellComponent : PowerStorageComponent
{
public override string Name => "PowerCell";

View File

@@ -3,12 +3,13 @@ using System.Text;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Power;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Map;
namespace Content.Server.GameObjects.Components.Power
{
[RegisterComponent]
public class PowerDebugTool : SharedPowerDebugTool, IAfterAttack
{
void IAfterAttack.AfterAttack(AfterAttackEventArgs eventArgs)

View File

@@ -1,22 +1,19 @@
using Content.Server.GameObjects.EntitySystems;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.IoC;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Content.Server.GameObjects.EntitySystems;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
using YamlDotNet.RepresentationModel;
namespace Content.Server.GameObjects.Components.Power
{
/// <summary>
/// Component that requires power to function
/// </summary>
[RegisterComponent]
public class PowerDeviceComponent : Component, EntitySystems.IExamine
{
public override string Name => "PowerDevice";

View File

@@ -1,18 +1,13 @@
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using System;
using Robust.Shared.ViewVariables;
using YamlDotNet.RepresentationModel;
namespace Content.Server.GameObjects.Components.Power
{
/// <summary>
/// Component that creates power and supplies it to the powernet
/// </summary>
[RegisterComponent]
public class PowerGeneratorComponent : Component
{
public override string Name => "PowerGenerator";

View File

@@ -1,10 +1,9 @@
using Robust.Server.GameObjects;
using System;
using System.Linq;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.IoC;
using System;
using System.Linq;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Power
@@ -12,6 +11,7 @@ namespace Content.Server.GameObjects.Components.Power
/// <summary>
/// Component that connects to the powernet
/// </summary>
[RegisterComponent]
public class PowerNodeComponent : Component
{
public override string Name => "PowerNode";

View File

@@ -1,22 +1,20 @@
using Robust.Server.GameObjects;
using System.Collections.Generic;
using System.Linq;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using Robust.Shared.ViewVariables;
using YamlDotNet.RepresentationModel;
namespace Content.Server.GameObjects.Components.Power
{
/// <summary>
/// Component that wirelessly connects and powers devices, connects to powernet via node and can be combined with internal storage component
/// </summary>
[RegisterComponent]
[ComponentReference(typeof(PowerDeviceComponent))]
public class PowerProviderComponent : PowerDeviceComponent
{
public override string Name => "PowerProvider";

View File

@@ -1,3 +1,4 @@
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
@@ -6,6 +7,8 @@ namespace Content.Server.GameObjects.Components.Power
/// <summary>
/// Feeds energy from the powernet and may have the ability to supply back into it
/// </summary>
[RegisterComponent]
[ComponentReference(typeof(PowerStorageComponent))]
public class PowerStorageNetComponent : PowerStorageComponent
{
public override string Name => "PowerStorage";

View File

@@ -1,20 +1,18 @@
using Content.Server.GameObjects.EntitySystems;
using Robust.Server.GameObjects;
using System.Linq;
using Content.Server.GameObjects.Components.Interactable.Tools;
using Content.Server.GameObjects.EntitySystems;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using System.Linq;
using Robust.Shared.Interfaces.GameObjects;
using Content.Server.GameObjects.Components.Interactable.Tools;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.IoC;
using Robust.Shared.ViewVariables;
using System;
namespace Content.Server.GameObjects.Components.Power
{
/// <summary>
/// Component to transfer power to nearby components, can create powernets and connect to nodes
/// </summary>
[RegisterComponent]
public class PowerTransferComponent : Component, IAttackBy
{
public override string Name => "PowerTransfer";

View File

@@ -17,6 +17,7 @@ namespace Content.Server.GameObjects.Components.Power
/// <summary>
/// Component that represents a wall light. It has a light bulb that can be replaced when broken.
/// </summary>
[RegisterComponent]
public class PoweredLightComponent : Component, IAttackHand, IAttackBy
{
public override string Name => "PoweredLight";

View File

@@ -1,5 +1,4 @@
using System;
using Content.Shared.GameObjects.Components.Power;
using Content.Shared.GameObjects.Components.Power;
using Content.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
@@ -11,6 +10,7 @@ namespace Content.Server.GameObjects.Components.Power
/// This is operations that are specific to the SMES, like UI and visuals.
/// Code interfacing with the powernet is handled in <see cref="PowerStorageComponent" />.
/// </summary>
[RegisterComponent]
public class SmesComponent : Component
{
public override string Name => "Smes";

View File

@@ -1,14 +1,15 @@
using System.Collections.Generic;
using Content.Server.GameObjects.Components.Mobs;
using Content.Shared.GameObjects;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Physics;
using Robust.Shared.Interfaces.GameObjects.Components;
using Content.Server.GameObjects.Components.Mobs;
using Content.Shared.GameObjects;
using Robust.Shared.Interfaces.Physics;
namespace Content.Server.GameObjects.Components.Projectiles
{
[RegisterComponent]
public class ProjectileComponent : Component, ICollideSpecial, ICollideBehavior
{
public override string Name => "Projectile";

View File

@@ -11,6 +11,7 @@ using Robust.Shared.IoC;
namespace Content.Server.GameObjects.Components
{
[RegisterComponent]
class ThrownItemComponent : ProjectileComponent, ICollideBehavior
{
#pragma warning disable 649

View File

@@ -6,15 +6,16 @@ using Content.Shared.GameObjects.Components.Research;
using Content.Shared.Research;
using Robust.Server.GameObjects.Components.UserInterface;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components.UserInterface;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
using Robust.Shared.Timers;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Research
{
[RegisterComponent]
[ComponentReference(typeof(IActivate))]
public class LatheComponent : SharedLatheComponent, IAttackBy, IActivate
{
public const int VolumePerSheet = 3750;

View File

@@ -1,4 +1,3 @@
using System.Collections.Generic;
using Content.Shared.GameObjects.Components.Research;
using Content.Shared.Research;
using Robust.Shared.GameObjects;
@@ -6,6 +5,8 @@ using Robust.Shared.Serialization;
namespace Content.Server.GameObjects.Components.Research
{
[RegisterComponent]
[ComponentReference(typeof(SharedLatheDatabaseComponent))]
public class LatheDatabaseComponent : SharedLatheDatabaseComponent
{
/// <summary>

View File

@@ -1,11 +1,12 @@
using System.Collections.Generic;
using Content.Shared.GameObjects.Components.Research;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.Serialization;
namespace Content.Server.GameObjects.Components.Research
{
[RegisterComponent]
[ComponentReference(typeof(SharedMaterialStorageComponent))]
public class MaterialStorageComponent : SharedMaterialStorageComponent
{
protected override Dictionary<string, int> Storage { get; set; } = new Dictionary<string, int>();

View File

@@ -1,29 +1,18 @@
using System;
using System.Collections.Generic;
using Robust.Shared.GameObjects;
using Robust.Shared.Log;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;
using Content.Server.Interfaces;
using Content.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
using Content.Server.GameObjects.EntitySystems;
using Robust.Server.GameObjects.EntitySystems;
using Content.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.IoC;
using Content.Server.GameObjects.EntitySystems;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Server.GameObjects.Components.Sound
{
/// <summary>
/// Simple sound emitter that emits sound on use in hand
/// </summary>
[RegisterComponent]
public class EmitSoundOnUseComponent : Component, IUse
{
/// <inheritdoc />
///
///
public override string Name => "EmitSoundOnUse";
public string _soundName;

View File

@@ -1,33 +1,25 @@
using System;
using System.Collections.Generic;
using Robust.Shared.GameObjects;
using Robust.Shared.Log;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;
using Content.Server.Interfaces;
using Content.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
using Content.Server.GameObjects.EntitySystems;
using Robust.Server.GameObjects.EntitySystems;
using Content.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Server.GameObjects.Components.Sound
{
/// <summary>
/// Changes footstep sound
/// </summary>
[RegisterComponent]
public class FootstepModifierComponent : Component
{
#pragma warning disable 649
[Dependency] private readonly IPrototypeManager _prototypeManager;
#pragma warning restore 649
/// <inheritdoc />
///
///
private Random _footstepRandom;
public override string Name => "FootstepModifier";

View File

@@ -1,16 +1,11 @@
using System.Collections.Generic;
using Content.Shared.GameObjects.Components.Sound;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Serialization;
namespace Content.Server.GameObjects.Components.Sound
{
[RegisterComponent]
public class SoundComponent : SharedSoundComponent
{
/// <summary>

View File

@@ -10,6 +10,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Stack
{
// TODO: Naming and presentation and such could use some improvement.
[RegisterComponent]
public class StackComponent : Component, IAttackBy, IExamine
{
private const string SerializationCache = "stack";

View File

@@ -1,10 +1,8 @@
using Content.Server.Interfaces.GameObjects;
using Content.Shared.Maths;
using System;
using Robust.Shared.GameObjects;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;
using System;
using Content.Server.Interfaces.GameObjects;
using Content.Shared.GameObjects;
using Content.Shared.Maths;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
@@ -15,6 +13,7 @@ namespace Content.Server.GameObjects
/// informing others of the current temperature,
/// and taking fire damage from high temperature.
/// </summary>
[RegisterComponent]
public class TemperatureComponent : Component, ITemperatureComponent
{
/// <inheritdoc />

View File

@@ -1,14 +1,15 @@
using System;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Triggers;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization;
using Robust.Shared.GameObjects;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Triggers;
namespace Content.Server.GameObjects.Components.Triggers
{
[RegisterComponent]
public class OnUseTimerTriggerComponent : Component, IUse
{
#pragma warning disable 649
@@ -28,7 +29,7 @@ namespace Content.Server.GameObjects.Components.Triggers
public override void Initialize()
{
base.Initialize();
base.Initialize();
}
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
@@ -41,4 +42,4 @@ namespace Content.Server.GameObjects.Components.Triggers
return true;
}
}
}
}

View File

@@ -1,14 +1,15 @@
using Robust.Shared.GameObjects;
using Content.Server.GameObjects.EntitySystems;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.Serialization;
using Content.Shared.GameObjects;
using Robust.Shared.Interfaces.Map;
namespace Content.Server.GameObjects.Components.Weapon.Melee
{
[RegisterComponent]
public class MeleeWeaponComponent : Component, IAttack
{
#pragma warning disable 649

View File

@@ -1,11 +1,13 @@
using System;
using Content.Shared.GameObjects.Components.Power;
using Content.Server.GameObjects.Components.Power;
using Robust.Shared.Serialization;
using Content.Shared.GameObjects.Components.Power;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Server.GameObjects.Components.Weapon.Ranged.Hitscan
{
[RegisterComponent]
public class HitscanWeaponCapacitorComponent : PowerCellComponent
{
private AppearanceComponent _appearance;

View File

@@ -1,6 +1,13 @@
using Content.Shared.GameObjects;
using System;
using Content.Server.GameObjects.Components.Power;
using Content.Server.GameObjects.Components.Sound;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects;
using Content.Shared.Interfaces;
using Content.Shared.Physics;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.EntitySystemMessages;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Physics;
@@ -10,16 +17,10 @@ using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
using Robust.Shared.Serialization;
using System;
using Content.Server.GameObjects.Components.Sound;
using Robust.Shared.GameObjects;
using Content.Server.GameObjects.EntitySystems;
using Content.Server.GameObjects.Components.Power;
using Content.Shared.Interfaces;
using Content.Shared.Physics;
namespace Content.Server.GameObjects.Components.Weapon.Ranged.Hitscan
{
[RegisterComponent]
public class HitscanWeaponComponent : Component, IAttackBy
{
private const float MaxLength = 20;

View File

@@ -3,6 +3,7 @@ using Robust.Shared.Serialization;
namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile
{
[RegisterComponent]
public class BallisticBulletComponent : Component
{
public override string Name => "BallisticBullet";

View File

@@ -11,6 +11,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile
{
[RegisterComponent]
public class BallisticMagazineComponent : Component, IMapInit
{
public override string Name => "BallisticMagazine";

View File

@@ -8,6 +8,7 @@ using Robust.Server.GameObjects;
using Robust.Server.GameObjects.Components.Container;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
@@ -16,6 +17,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile
{
[RegisterComponent]
public class BallisticMagazineWeaponComponent : BallisticWeaponComponent, IUse, IAttackBy, IMapInit
{
public override string Name => "BallisticMagazineWeapon";

View File

@@ -1,18 +1,17 @@
using System;
using Robust.Shared.GameObjects;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Weapons.Ranged;
using Robust.Server.Interfaces.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Timers;
namespace Content.Server.GameObjects.Components.Weapon.Ranged
{
[RegisterComponent]
public sealed class RangedWeaponComponent : SharedRangedWeaponComponent
{
private TimeSpan _lastFireTime;

View File

@@ -55,7 +55,7 @@ namespace Content.Shared.Chemistry
}
/// <summary>
/// Adds a given quantity of a reagent directly into the solution.
/// Adds a given quantity of a reagent directly into the solution.
/// </summary>
/// <param name="reagentId">The prototype ID of the reagent to add.</param>
/// <param name="quantity">The quantity in milli-units.</param>
@@ -193,7 +193,7 @@ namespace Content.Shared.Chemistry
return newSolution;
}
public void AddSolution(Solution otherSolution)
{
for (var i = 0; i < otherSolution._contents.Count; i++)
@@ -232,7 +232,7 @@ namespace Content.Shared.Chemistry
newSolution._contents.Add(reagent);
volume += reagent.Quantity;
}
newSolution.TotalVolume = volume;
return newSolution;
}
@@ -257,7 +257,7 @@ namespace Content.Shared.Chemistry
}
#region Enumeration
public IEnumerator<ReagentQuantity> GetEnumerator()
{
return _contents.GetEnumerator();

View File

@@ -14,6 +14,7 @@ namespace Content.Shared.GameObjects.Components.Materials
/// Component to store data such as "this object is made out of steel".
/// This is not a storage system for say smelteries.
/// </summary>
[RegisterComponent]
public class MaterialComponent : Component
{
public const string SerializationCache = "mat";

View File

@@ -7,6 +7,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
/// <summary>
/// Component required for a player to be able to examine things.
/// </summary>
[RegisterComponent]
public sealed class ExaminerComponent : Component
{
public override string Name => "Examiner";