public static void Write(UnsafeWriter writer, InjectedHlslLocationInfo value) { UnsafeMarshallers.FileSystemPathMarshaller.Marshal(writer, value.FileSystemPath); writer.Write(value.Range.StartOffset); writer.Write(value.Range.EndOffset); writer.WriteEnum(value.ProgramType); }
public void WriteValue(SerializationCtx context, UnsafeWriter writer) { Assertion.Assert(!myHandler.IsSendWithoutContexts, "!myHandler.IsWritingOwnMessages"); var value = Context.Value; if (value == null) { InternId.Write(writer, InternId.Invalid); writer.Write(false); } else { using (myHandler.CreateSendWithoutContextsCookie()) { if (!myProtocolValueSet.Contains(value)) { Assertion.Require(Proto.Scheduler.IsActive, "Attempting to use previously unused context value {0} on a background thread for key {1}", value, Context.Key); myProtocolValueSet.Add(Context.Value); } var internedId = myInternRoot.Intern(value); InternId.Write(writer, internedId); if (!internedId.IsValid) { writer.Write(true); Context.WriteDelegate(context, writer, value); } } } }
private static void Write(UnsafeWriter writer, AssetDocumentHierarchyElement value) { writer.Write(value.myOtherBoxedElements.Count); writer.Write(value.myGameObjectHierarchies.Count); writer.Write(value.myTransformElements.Count); writer.Write(value.myScriptComponentElements.Count); writer.Write(value.myComponentElements.Count); foreach (var v in value.myOtherBoxedElements) { WriteHierarchyElement(writer, v); } foreach (var v in value.myGameObjectHierarchies) { GameObjectHierarchy.Write(writer, v); } foreach (var v in value.myTransformElements) { TransformHierarchy.Write(writer, v); } foreach (var v in value.myScriptComponentElements) { ScriptComponentHierarchy.Write(writer, v); } foreach (var v in value.myComponentElements) { ComponentHierarchy.Write(writer, v); } }
public void WriteValue(SerializationCtx context, UnsafeWriter writer) { Assertion.Assert(!myHandler.IsSendWithoutContexts, "!myHandler.IsWritingOwnMessages"); var value = Context.Value; if (value == null) { InternId.Write(writer, InternId.Invalid); writer.Write(false); } else { using (myHandler.CreateSendWithoutContextsCookie()) { AddValueToProtocolValueSetImpl(value); var internedId = myInternRoot.Intern(value); InternId.Write(writer, internedId); if (!internedId.IsValid) { writer.Write(true); Context.WriteDelegate(context, writer, value); } } } }
private static void WriteSet(UnsafeWriter writer, JetHashSet <string> list) { writer.Write(list.Count); foreach (var value in list) { writer.Write(value); } }
public void Write(UnsafeWriter writer) { writer.Write(Name); writer.Write(Type); writer.Write(IsOptional); writer.Write(Description); writer.Write(DefaultValue); }
private static void Write(UnsafeWriter writer, GameObjectHierarchy value) { writer.WritePolymorphic(value.Location); writer.Write(value.Name); writer.WritePolymorphic(value.PrefabInstance); writer.WritePolymorphic(value.CorrespondingSourceObject); writer.Write(value.IsStripped); }
private static void WriteAnchors([NotNull] UnsafeWriter writer, LocalList <long> anchors) { writer.Write(anchors.Count); foreach (var anchor in anchors) { writer.Write(anchor); } }
public void Write(UnsafeWriter writer) { writer.Write(Name); writer.Write(Type); writer.Write(IsOptional); writer.Write(Description); writer.Write(DefaultValue); }
private static void WriteStateNames([NotNull] UnsafeWriter writer, [NotNull, ItemNotNull] ICollection <string> stateNames) { writer.Write(stateNames.Count); foreach (var stateName in stateNames) { writer.Write(stateName); } }
public void Marshal(UnsafeWriter writer, SpecflowStepsUsagesCacheEntries value) { writer.Write(value.Count); foreach (var entry in value) { writer.Write((int)entry.StepKind); writer.Write(entry.StepText); } }
private static void Write(UnsafeWriter writer, GameObjectHierarchyElement value) { value.Id.WriteTo(writer); value.CorrespondingSourceObject.WriteTo(writer); value.PrefabInstance.WriteTo(writer); writer.Write(value.IsStripped); value.TransformId.WriteTo(writer); writer.Write(value.Name); }
public void WriteTo([NotNull] UnsafeWriter writer) { Location.WriteTo(writer); writer.Write(AnimationName); writer.Write(SampleRate); writer.Write(FunctionName); writer.Write(Time); writer.Write(Guid); }
private void WriteStateMachineBehavioursAnchors([NotNull] UnsafeWriter writer) { var stateMachineBehavioursAnchors = ScriptsAnchors; writer.Write(stateMachineBehavioursAnchors.Count); foreach (var anchor in stateMachineBehavioursAnchors) { writer.Write(anchor); } }
public void WriteTo(UnsafeWriter writer) { writer.WritePolymorphic(Location); writer.Write(MethodName); writer.Write(TextRange.StartOffset); writer.Write(TextRange.EndOffset); writer.Write((int)Mode); writer.Write(Type); writer.WritePolymorphic(TargetScriptReference); }
private static void Write(UnsafeWriter writer, TransformHierarchy value) { writer.WritePolymorphic(value.Location); writer.WritePolymorphic(value.GameObjectReference); writer.WritePolymorphic(value.Parent); writer.Write(value.RootIndex); writer.WritePolymorphic(value.PrefabInstance); writer.WritePolymorphic(value.CorrespondingSourceObject); writer.Write(value.IsStripped); }
private static void WriteChildToParentMap([NotNull] UnsafeWriter writer, [NotNull] IDictionary <long, long> childToParent) { writer.Write(childToParent.Count); foreach (var(child, parent) in childToParent) { writer.Write(child); writer.Write(parent); } }
private static void WriteGuidToAnchorsEntry([NotNull] UnsafeWriter writer, Guid guid, [NotNull] ICollection <long> anchors) { writer.Write(guid); writer.Write(anchors.Count); foreach (var anchor in anchors) { writer.Write(anchor); } }
public void WriteTo(UnsafeWriter writer) { writer.Write(Name); OwningScriptLocation.WriteTo(writer); ScriptReference.WriteTo(writer); writer.Write(Calls.Count); foreach (var call in Calls) { call.WriteTo(writer); } }
private static void WriteAnchorToUsagesEntry <T>([NotNull] UnsafeWriter writer, long anchor, [NotNull][ItemNotNull] ICollection <T> usages) where T : IAnimatorScriptUsage { writer.Write(anchor); writer.Write(usages.Count); foreach (var usage in usages) { usage.WriteTo(writer); } }
public static void Write(UnsafeWriter writer, PrefabInstanceHierarchy prefabInstanceHierarchy) { prefabInstanceHierarchy.Location.WriteTo(writer); prefabInstanceHierarchy.ParentTransform.WriteTo(writer); writer.Write(prefabInstanceHierarchy.PrefabModifications.Count); foreach (var prefabModification in prefabInstanceHierarchy.PrefabModifications) { writer.WritePolymorphic(prefabModification); } writer.Write(prefabInstanceHierarchy.SourcePrefabGuid); }
public void Marshal([NotNull] UnsafeWriter writer, [NotNull] LinkedNamesData value) { writer.Write(value.Count); foreach (var map in value) { writer.Write(map.Key); writer.Write(map.Value.Count); foreach (var name in map.Value) { writer.Write(name); } } }
public static void WriteCollection <T>(this UnsafeWriter writer, CtxWriteDelegate <T> itemWriter, SerializationCtx ctx, ICollection <T> value) { if (value == null) { writer.Write(-1); return; } writer.Write(value.Count); foreach (var item in value) { itemWriter(ctx, writer, item); } }
public static void Write(SerializationCtx ctx, UnsafeWriter writer, RdProperty <T> value) { Assertion.Assert(!value.RdId.IsNil, "!value.RdId.IsNil"); writer.Write(value.RdId); if (value.HasValue()) { writer.Write(true); value.WriteValueDelegate(ctx, writer, value.Value); } else { writer.Write(false); } }
public static void WriteArray <T>(this UnsafeWriter writer, CtxWriteDelegate <T> itemWriter, SerializationCtx ctx, T[] value) { if (value == null) { writer.Write(-1); return; } writer.Write(value.Length); // ReSharper disable once ForCanBeConvertedToForeach for (var i = 0; i < value.Length; i++) { itemWriter(ctx, writer, value[i]); } }
private static void Write(UnsafeWriter writer, InspectorVariableUsage value) { value.Location.WriteTo(writer); value.ScriptReference.WriteTo(writer); writer.Write(value.Name); writer.WritePolymorphic(value.Value); }
private static void WriteTestAnchorToUsageEntry([NotNull] UnsafeWriter writer, long anchor, [NotNull] IAnimatorScriptUsage usage) { writer.Write(anchor); usage.WriteTo(writer); }
public void Write <T>(SerializationCtx ctx, UnsafeWriter writer, T value) { #if !NET35 myBackgroundRegistrar.WaitForEmpty(); #endif if (value == null) { // ReSharper disable once ImpureMethodCallOnReadonlyValueField RdId.Nil.Write(writer); return; } RdId typeId; var type = value.GetType(); if (!myTypeMapping.TryGetValue(type, out typeId)) { myPolymorphicCatalog?.TryDiscoverRegister(type, this); if (!myTypeMapping.TryGetValue(type, out typeId)) { throw new KeyNotFoundException($"Type {type.FullName} have not registered"); } } typeId.Write(writer); // Don't dispose this cookie, otherwise it will delete all written data var cookie = new UnsafeWriter.Cookie(writer); writer.Write(0); var writerDelegate = myWriters[typeId]; writerDelegate(ctx, writer, value); cookie.WriteIntLengthToCookieStart(); }
public static void Write(UnsafeWriter writer, TransformHierarchy transformHierarchy) { transformHierarchy.Location.WriteTo(writer); transformHierarchy.OwningGameObject.WriteTo(writer); transformHierarchy.ParentTransform.WriteTo(writer); writer.Write(transformHierarchy.myRootIndex); }
public void WriteTo(UnsafeWriter writer) { Location.WriteTo(writer); writer.Write(Name); WriteAnchors(writer, ScriptsAnchors); WriteAnchors(writer, ChildStateMachinesAnchors); WriteAnchors(writer, ChildStatesAnchors); }
private static void Write(UnsafeWriter writer, AssetMethodsDataElement value) { writer.Write(value.Methods.Count); foreach (var v in value.Methods) { v.WriteTo(writer); } }
private static void Write(UnsafeWriter writer, AngularJsCacheItems value) { writer.Write<Directive, ICollection<Directive>>((w, directive) => directive.Write(w), value.Directives.ToList()); writer.Write<Filter, ICollection<Filter>>((w, filter) => filter.Write(w), value.Filters.ToList()); }
public void Write(UnsafeWriter writer) { writer.Write(OriginalName); writer.Write(Name); writer.Write(Restrictions); writer.Write(UnsafeWriter.StringDelegate, Tags); writer.Write(Offset); writer.Write<Parameter, ICollection<Parameter>>((w, parameter) => parameter.Write(w), Parameters.ToList()); }
public void Write(UnsafeWriter writer) { writer.Write(Name); writer.Write(Offset); }