A bunch of AttachedEntity bullshit

This commit is contained in:
metalgearsloth
2021-12-06 15:39:46 +11:00
parent 215cae5655
commit 525297c5fe
58 changed files with 135 additions and 133 deletions

View File

@@ -75,7 +75,7 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.Mobs
await server.WaitAssertion(() =>
{
var playerEnt = serverPlayerManager.Sessions.Single().AttachedEntity;
var actionsComponent = sEntities.GetComponent<ServerActionsComponent>(playerEnt!.Value);
var actionsComponent = sEntities.GetComponent<ServerActionsComponent>(playerEnt);
// player should begin with their innate actions granted
innateActions.AddRange(actionsComponent.InnateActions);
@@ -157,7 +157,7 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.Mobs
await server.WaitAssertion(() =>
{
var playerEnt = serverPlayerManager.Sessions.Single().AttachedEntity;
var actionsComponent = IoCManager.Resolve<IEntityManager>().GetComponent<ServerActionsComponent>(playerEnt!.Value);
var actionsComponent = IoCManager.Resolve<IEntityManager>().GetComponent<ServerActionsComponent>(playerEnt);
actionsComponent.Revoke(ActionType.DebugInstant);
});
@@ -250,7 +250,7 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.Mobs
await server.WaitAssertion(() =>
{
serverPlayerEnt = serverPlayerManager.Sessions.Single().AttachedEntity!.Value;
serverPlayerEnt = serverPlayerManager.Sessions.Single().AttachedEntity;
serverActionsComponent = serverEntManager.GetComponent<ServerActionsComponent>(serverPlayerEnt);
// spawn and give them an item that has actions

View File

@@ -30,8 +30,8 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.Mobs
await server.WaitAssertion(() =>
{
var playerEnt = serverPlayerManager.Sessions.Single().AttachedEntity;
Assert.NotNull(playerEnt);
var alertsComponent = IoCManager.Resolve<IEntityManager>().GetComponent<ServerAlertsComponent>(playerEnt!.Value);
Assert.That(playerEnt != default);
var alertsComponent = IoCManager.Resolve<IEntityManager>().GetComponent<ServerAlertsComponent>(playerEnt);
Assert.NotNull(alertsComponent);
// show 2 alerts
@@ -70,8 +70,8 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.Mobs
await server.WaitAssertion(() =>
{
var playerEnt = serverPlayerManager.Sessions.Single().AttachedEntity;
Assert.NotNull(playerEnt);
var alertsComponent = IoCManager.Resolve<IEntityManager>().GetComponent<ServerAlertsComponent>(playerEnt!.Value);
Assert.That(playerEnt != default);
var alertsComponent = IoCManager.Resolve<IEntityManager>().GetComponent<ServerAlertsComponent>(playerEnt);
Assert.NotNull(alertsComponent);
alertsComponent.ClearAlert(AlertType.Debug1);