mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Shared Containers (#1579)
* Added a basic server simulation framework for help with tests. * Moved as much as possible to Robust.Shared/Containers. Moved ContainerSlot from content to engine. * Moved ClientContainer to shared. * Merged client/server ContainerManagerComponents into a single shared version. * ContainerManagerComponent is now implicitly registered with the attributes. * Migrated to 2021 serialization technology. * Existing Unit Tests work. * More tests coverage. Fixed bug with transferring items between containers. * Container Type info is now sent over the network. * Merge client/server container systems. * Code cleanup. * Attempted to fix dictionary serialization. Logs warning when trying to check if an unknown GridId is paused. * Remove OldCode.
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
using NetSerializer;
|
||||
using NetSerializer;
|
||||
using Robust.Shared.IoC;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Reflection;
|
||||
@@ -182,6 +183,23 @@ namespace Robust.Shared.Serialization
|
||||
public bool CanSerialize(Type type)
|
||||
=> _serializableTypes.Contains(type);
|
||||
|
||||
/// <inheritdoc />
|
||||
public Type? FindSerializedType(Type assignableType, string serializedTypeName)
|
||||
{
|
||||
var types = _reflectionManager.GetAllChildren(assignableType);
|
||||
foreach (var type in types)
|
||||
{
|
||||
var serializedAttribute = type.GetCustomAttribute<SerializedTypeAttribute>();
|
||||
|
||||
if(serializedAttribute is null)
|
||||
continue;
|
||||
|
||||
if (serializedAttribute.SerializeName == serializedTypeName)
|
||||
return type;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user