await server.WaitAssertion(() =>
{
user = sEntities.SpawnEntity(null, coords);
- user.EnsureComponent<HandsComponent>();
+ sEntities.EnsureComponent<HandsComponent>(user);
handSys.AddHand(user, "hand", HandLocation.Left);
target = sEntities.SpawnEntity(null, coords);
item = sEntities.SpawnEntity(null, coords);
- item.EnsureComponent<ItemComponent>();
+ sEntities.EnsureComponent<ItemComponent>(item);
});
await server.WaitRunTicks(1);
await server.WaitAssertion(() =>
{
user = sEntities.SpawnEntity(null, coords);
- user.EnsureComponent<HandsComponent>();
+ sEntities.EnsureComponent<HandsComponent>(user);
handSys.AddHand(user, "hand", HandLocation.Left);
target = sEntities.SpawnEntity(null, new MapCoordinates(new Vector2(1.9f, 0), mapId));
item = sEntities.SpawnEntity(null, coords);
- item.EnsureComponent<ItemComponent>();
+ sEntities.EnsureComponent<ItemComponent>(item);
wall = sEntities.SpawnEntity("DummyDebugWall", new MapCoordinates(new Vector2(1, 0), sEntities.GetComponent<TransformComponent>(user).MapID));
});
await server.WaitAssertion(() =>
{
user = sEntities.SpawnEntity(null, coords);
- user.EnsureComponent<HandsComponent>();
+ sEntities.EnsureComponent<HandsComponent>(user);
handSys.AddHand(user, "hand", HandLocation.Left);
target = sEntities.SpawnEntity(null, new MapCoordinates(new Vector2(SharedInteractionSystem.InteractionRange - 0.1f, 0), mapId));
item = sEntities.SpawnEntity(null, coords);
- item.EnsureComponent<ItemComponent>();
+ sEntities.EnsureComponent<ItemComponent>(item);
});
await server.WaitRunTicks(1);
await server.WaitAssertion(() =>
{
user = sEntities.SpawnEntity(null, coords);
- user.EnsureComponent<HandsComponent>();
+ sEntities.EnsureComponent<HandsComponent>(user);
handSys.AddHand(user, "hand", HandLocation.Left);
target = sEntities.SpawnEntity(null, new MapCoordinates(new Vector2(SharedInteractionSystem.InteractionRange + 0.01f, 0), mapId));
item = sEntities.SpawnEntity(null, coords);
- item.EnsureComponent<ItemComponent>();
+ sEntities.EnsureComponent<ItemComponent>(item);
});
await server.WaitRunTicks(1);
await server.WaitAssertion(() =>
{
user = sEntities.SpawnEntity(null, coords);
- user.EnsureComponent<HandsComponent>();
+ sEntities.EnsureComponent<HandsComponent>(user);
handSys.AddHand(user, "hand", HandLocation.Left);
target = sEntities.SpawnEntity(null, coords);
item = sEntities.SpawnEntity(null, coords);
- item.EnsureComponent<ItemComponent>();
+ sEntities.EnsureComponent<ItemComponent>(item);
containerEntity = sEntities.SpawnEntity(null, coords);
container = conSystem.EnsureContainer<Container>(containerEntity, "InteractionTestContainer");
});
CloseSessionFor(player, gamer.Tabletop, false);
// Set the entity as an absolute GAMER.
- attachedEntity.EnsureComponent<TabletopGamerComponent>().Tabletop = uid;
+ EnsureComp<TabletopGamerComponent>(attachedEntity).Tabletop = uid;
// Create a camera for the gamer to use
var camera = CreateCamera(tabletop, player);
var camera = EntityManager.SpawnEntity(null, session.Position.Offset(offset));
// Add an eye component and disable FOV
- var eyeComponent = camera.EnsureComponent<EyeComponent>();
+ var eyeComponent = EnsureComp<EyeComponent>(camera);
_eye.SetDrawFov(camera, false, eyeComponent);
_eye.SetZoom(camera, tabletop.CameraZoom, eyeComponent);
+using Content.Shared.Singularity.EntitySystems;
using Robust.Shared.GameStates;
-using Robust.Shared.Serialization;
namespace Content.Shared.Singularity.Components
{
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState]
+ [Access(typeof(SharedSingularitySystem))]
public sealed partial class SingularityDistortionComponent : Component
{
- // TODO: use access and remove this funny stuff
- [DataField("intensity")]
- private float _intensity = 31.25f;
+ [DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
+ public float Intensity = 31.25f;
- [DataField("falloffPower")]
- private float _falloffPower = MathF.Sqrt(2f);
-
- [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
- public float Intensity
- {
- get => _intensity;
- set => this.SetAndDirtyIfChanged(ref _intensity, value);
- }
-
- [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
- public float FalloffPower
- {
- get => _falloffPower;
- set => this.SetAndDirtyIfChanged(ref _falloffPower, value);
- }
+ [DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
+ public float FalloffPower = MathF.Sqrt(2f);
}
}