Update to latest GC update
This commit is contained in:
parent
9bc04099a6
commit
c13789eac2
9 changed files with 17 additions and 16 deletions
|
@ -235,7 +235,7 @@
|
|||
<HintPath>..\ref\Gamecraft_Data\Managed\StringFormatter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Svelto.Common">
|
||||
<HintPath>..\ref\Gamecraft_Data\Managed\Svelto.Common.dll</HintPath>
|
||||
<HintPath>..\ref\Gamecraft_Data\Managed\Svelto.Common_3.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Svelto.ECS.Debugger">
|
||||
<HintPath>..\ref\Gamecraft_Data\Managed\Svelto.ECS.Debugger.dll</HintPath>
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace GamecraftScripting.Serialization
|
|||
{
|
||||
EGID newScriptId = new EGID(j, ScriptBuilder.ScriptGroup);
|
||||
// why doesn't \/this\/ do anything?
|
||||
____entitySerializer.DeserializeNewEntity(newScriptId, ____serializationData, SerializationType.Storage);
|
||||
____entitySerializer.DeserializeNewEntity(newScriptId, ____serializationData, (int)SerializationType.Storage);
|
||||
}
|
||||
bbr = new BinaryBufferReader(____bytesStream.ToArrayFast(out count), ____serializationData.dataPos);
|
||||
uint actualStart = bbr.ReadUint();
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace GamecraftScripting.Serialization
|
|||
for (uint i = 0; i < count; i++)
|
||||
{
|
||||
EGID scriptId = new EGID(i, ScriptBuilder.ScriptGroup);
|
||||
entitySerializer.SerializeEntity(scriptId, serializationData, SerializationType.Storage);
|
||||
entitySerializer.SerializeEntity(scriptId, serializationData, (int)SerializationType.Storage);
|
||||
}
|
||||
bbw = new BinaryBufferWriter(serializationData.data.ToArrayFast(out buffLen), serializationData.dataPos);
|
||||
serializationData.data.ExpandBy(4u);
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace GamecraftScripting.Serialization
|
|||
public static EGID BuildScriptEntity(string name, string script, IEntityFactory entityFactory)
|
||||
{
|
||||
EGID scriptId = new EGID(nextScriptId++, ScriptGroup);
|
||||
EntityStructInitializer builder = entityFactory.BuildEntity<ScriptEntityDescriptor>(scriptId);
|
||||
EntityComponentInitializer builder = entityFactory.BuildEntity<ScriptEntityDescriptor>(scriptId);
|
||||
builder.Init(new ScriptStruct {
|
||||
name = new ECSString(name),
|
||||
script = new ECSString(script),
|
||||
|
|
|
@ -13,11 +13,11 @@ namespace GamecraftScripting.Serialization
|
|||
this.entityFactory = entityFactory;
|
||||
}
|
||||
|
||||
public EntityStructInitializer BuildDeserializedEntity(EGID egid, ISerializationData serializationData, ISerializableEntityDescriptor entityDescriptor, SerializationType serializationType, IEntitySerialization entitySerialization)
|
||||
public EntityComponentInitializer BuildDeserializedEntity(EGID egid, ISerializationData serializationData, ISerializableEntityDescriptor entityDescriptor, int serializationType, IEntitySerialization entitySerialization)
|
||||
{
|
||||
Logging.MetaLog(entityFactory == null);
|
||||
EntityStructInitializer esi = entityFactory.BuildEntity<ScriptEntityDescriptor>(egid);
|
||||
entitySerialization.DeserializeEntityStructs(serializationData, entityDescriptor, ref esi, serializationType);
|
||||
EntityComponentInitializer esi = entityFactory.BuildEntity<ScriptEntityDescriptor>(egid);
|
||||
entitySerialization.DeserializeEntityComponents(serializationData, entityDescriptor, ref esi, serializationType);
|
||||
Logging.MetaLog($"Deserialized script named {esi.Get<ScriptStruct>().name.ToString()}");
|
||||
return esi;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using RobocraftX.Common;
|
||||
using Svelto.ECS;
|
||||
using Svelto.ECS.Serialization;
|
||||
|
||||
|
@ -9,12 +10,12 @@ namespace GamecraftScripting.Serialization
|
|||
[HashName("GamecraftScriptingScriptEntityDescriptorV0")]
|
||||
public class _ScriptEntityDescriptor : IEntityDescriptor
|
||||
{
|
||||
public IEntityBuilder[] entitiesToBuild => _entityBuilders;
|
||||
public IComponentBuilder[] componentsToBuild => _entityBuilders;
|
||||
|
||||
private static readonly IEntityBuilder[] _entityBuilders = new IEntityBuilder[1]
|
||||
private static readonly IComponentBuilder[] _entityBuilders = new IComponentBuilder[1]
|
||||
{
|
||||
new SerializableEntityBuilder<ScriptStruct>((SerializationType.Network, new ScriptSerializer()),
|
||||
(SerializationType.Storage, new ScriptSerializer()))
|
||||
new SerializableComponentBuilder<SerializationType, ScriptStruct>(((int)SerializationType.Network, new ScriptSerializer()),
|
||||
((int)SerializationType.Storage, new ScriptSerializer()))
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -22,7 +23,7 @@ namespace GamecraftScripting.Serialization
|
|||
{
|
||||
GamecraftModdingAPI.Utility.Logging.MetaLog("ScriptEntityDescriptor Initialized");
|
||||
GamecraftModdingAPI.Utility.Logging.MetaLog($"Entities to serialize: {entitiesToSerialize.Length}");
|
||||
GamecraftModdingAPI.Utility.Logging.MetaLog($"Entities to serialize: {entitiesToBuild.Length}");
|
||||
GamecraftModdingAPI.Utility.Logging.MetaLog($"Entities to serialize: {componentsToBuild.Length}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ using Svelto.ECS.Serialization;
|
|||
|
||||
namespace GamecraftScripting.Serialization
|
||||
{
|
||||
public class ScriptSerializer : ISerializer<ScriptStruct>
|
||||
public class ScriptSerializer : IComponentSerializer<ScriptStruct>
|
||||
{
|
||||
private static readonly UTF8Encoding utf8Encoding = new UTF8Encoding();
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ using Svelto.ECS.Experimental;
|
|||
|
||||
namespace GamecraftScripting.Serialization
|
||||
{
|
||||
public struct ScriptStruct : IEntityStruct
|
||||
public struct ScriptStruct : IEntityComponent
|
||||
{
|
||||
public ECSString name;
|
||||
|
||||
|
|
|
@ -15,9 +15,9 @@ namespace GamecraftScripting.Serialization
|
|||
{
|
||||
if (descriptor.entitiesToSerialize.Length == 0)
|
||||
{
|
||||
if (descriptor.entitiesToBuild.Length != 0)
|
||||
if (descriptor.componentsToBuild.Length != 0)
|
||||
{
|
||||
Logging.MetaLog($"Descriptor: {descriptor.entitiesToBuild[0].GetType().FullName} (hash:{descriptor.hash})");
|
||||
Logging.MetaLog($"Descriptor: {descriptor.componentsToBuild[0].GetType().FullName} (hash:{descriptor.hash})");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue