Shared Containers (#3331)
* Namespace changes for containers. Moved ContainerSlot from content to engine. * Merged client/server ContainerManagerComponents into a single shared version. * Mapfile and nullability fixes. * Upgrades map. * Update engine.
This commit is contained in:
@@ -11,7 +11,7 @@ using Content.Shared.Construction;
|
||||
using Content.Shared.GameObjects.Components.Interactable;
|
||||
using Content.Shared.GameObjects.EntitySystems;
|
||||
using Content.Shared.Interfaces.GameObjects.Components;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
@@ -286,7 +286,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
else
|
||||
{
|
||||
_containers.Add(insertStep.Store);
|
||||
var container = ContainerManagerComponent.Ensure<Container>(insertStep.Store, Owner);
|
||||
var container = ContainerHelpers.EnsureContainer<Container>(Owner, insertStep.Store);
|
||||
container.Insert(entityUsing);
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
{
|
||||
foreach (var container in _containers)
|
||||
{
|
||||
var otherContainer = ContainerManagerComponent.Ensure<Container>(container, entity);
|
||||
var otherContainer = ContainerHelpers.EnsureContainer<Container>(entity, container);
|
||||
var ourContainer = containerComp.GetContainer(container);
|
||||
|
||||
foreach (var ent in ourContainer.ContainedEntities.ToArray())
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using Content.Server.Construction;
|
||||
using Content.Server.Interfaces.GameObjects;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
@@ -28,8 +29,8 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
_boardContainer = ContainerManagerComponent.Ensure<Container>(MachineFrameComponent.BoardContainer, Owner);
|
||||
_partContainer = ContainerManagerComponent.Ensure<Container>(MachineFrameComponent.PartContainer, Owner);
|
||||
_boardContainer = ContainerHelpers.EnsureContainer<Container>(Owner, MachineFrameComponent.BoardContainer);
|
||||
_partContainer = ContainerHelpers.EnsureContainer<Container>(Owner, MachineFrameComponent.PartContainer);
|
||||
}
|
||||
|
||||
protected override void Startup()
|
||||
@@ -59,8 +60,8 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
public void CreateBoardAndStockParts()
|
||||
{
|
||||
// Entity might not be initialized yet.
|
||||
var boardContainer = ContainerManagerComponent.Ensure<Container>(MachineFrameComponent.BoardContainer, Owner, out var existedBoard);
|
||||
var partContainer = ContainerManagerComponent.Ensure<Container>(MachineFrameComponent.PartContainer, Owner, out var existedParts);
|
||||
var boardContainer = ContainerHelpers.EnsureContainer<Container>(Owner, MachineFrameComponent.BoardContainer, out var existedBoard);
|
||||
var partContainer = ContainerHelpers.EnsureContainer<Container>(Owner, MachineFrameComponent.PartContainer, out var existedParts);
|
||||
|
||||
if (string.IsNullOrEmpty(BoardPrototype))
|
||||
return;
|
||||
|
||||
@@ -87,8 +87,8 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
_boardContainer = ContainerManagerComponent.Ensure<Container>(BoardContainer, Owner);
|
||||
_partContainer = ContainerManagerComponent.Ensure<Container>(PartContainer, Owner);
|
||||
_boardContainer = ContainerHelpers.EnsureContainer<Container>(Owner, BoardContainer);
|
||||
_partContainer = ContainerHelpers.EnsureContainer<Container>(Owner, PartContainer);
|
||||
}
|
||||
|
||||
protected override void Startup()
|
||||
|
||||
Reference in New Issue
Block a user