public void Write(OsiWriter writer) { writer.Write(Index); writer.Write(Name); writer.Write(SubGoalCombination); writer.Write((UInt32)ParentGoals.Count); foreach (var goalIndex in ParentGoals) { writer.Write(goalIndex); } writer.Write((UInt32)SubGoals.Count); foreach (var goalIndex in SubGoals) { writer.Write(goalIndex); } writer.Write(Unknown); if (writer.MajorVersion > 1 || (writer.MajorVersion == 1 && writer.MinorVersion >= 1)) { writer.WriteList <Call>(InitCalls); writer.WriteList <Call>(ExitCalls); } }
public override void Write(OsiWriter writer) { base.Write(writer); writer.Write(Index); writer.Write(Unused); writer.Write(Adapted); }
public virtual void Write(OsiWriter writer) { writer.Write((byte)48); writer.Write(TypeId); switch ((Type)TypeId) { case Type.Unknown: break; case Type.Integer: writer.Write(IntValue); break; case Type.Float: writer.Write(FloatValue); break; case Type.String: writer.Write(StringValue != null); if (StringValue != null) { writer.Write(StringValue); } break; default: writer.Write(StringValue); break; } }
public override void Write(OsiWriter writer) { base.Write(writer); writer.Write(IsValid); writer.Write(OutParam); writer.Write(IsAType); }
public void Write(OsiWriter writer) { writer.Write((byte)Types.Count); foreach (var type in Types) { writer.Write(type); } }
public void Write(OsiWriter writer) { writer.Write((byte)Columns.Count); foreach (var column in Columns) { column.Write(writer); } }
public virtual void Write(OsiWriter writer) { DatabaseRef.Write(writer); writer.Write(Name); if (Name.Length > 0) { writer.Write(NameIndex); } }
public void Write(OsiWriter writer) { writer.Write(Name); writer.Write(Type); writer.Write(Key1); writer.Write(Key2); writer.Write(Key3); writer.Write(Key4); }
public void Write(OsiWriter writer) { writer.Write((byte)Logical.Count); foreach (var logical in Logical) { writer.Write((byte)logical.Key); logical.Value.Write(writer); } }
public override void Write(OsiWriter writer) { base.Write(writer); ParentRef.Write(writer); AdapterRef.Write(writer); RelDatabaseNodeRef.Write(writer); RelJoin.Write(writer); writer.Write(RelDatabaseIndirection); }
public void Write(OsiWriter writer) { writer.Write(Line); writer.Write(Unknown1); writer.Write(Unknown2); NodeRef.Write(writer); writer.Write((byte)Type); writer.Write(GUID); Name.Write(writer); }
public override void Write(OsiWriter writer) { base.Write(writer); writer.Write(Value1Index); writer.Write(Value2Index); Value1.Write(writer); Value2.Write(writer); writer.Write((UInt32)RelOp); }
public void Write(OsiWriter writer) { writer.Write(Name); writer.Write(Index); if (writer.Ver >= OsiVersion.VerTypeAliases) { writer.Write(Alias); } }
public override void Write(OsiWriter writer) { base.Write(writer); writer.Write(LeftValueIndex); writer.Write(RightValueIndex); LeftValue.Write(writer); RightValue.Write(writer); writer.Write((UInt32)RelOp); }
public override void Write(OsiWriter writer) { base.Write(writer); ParentRef.Write(writer); AdapterRef.Write(writer); RelDatabaseRef.Write(writer); RelDatabase.Write(writer); writer.Write(RelDatabaseFlag); }
public void Write(OsiWriter writer) { writer.Write(Name); writer.Write((UInt32)OutParamMask.Count); foreach (var b in OutParamMask) { writer.Write(b); } Parameters.Write(writer); }
public void Write(OsiWriter writer) { writer.Write(Line); writer.Write(ConditionReferences); writer.Write(ActionReferences); NodeRef.Write(writer); writer.Write((byte)Type); writer.Write(Meta1); writer.Write(Meta2); writer.Write(Meta3); writer.Write(Meta4); Name.Write(writer); }
public override void Write(OsiWriter writer) { base.Write(writer); LeftParentRef.Write(writer); RightParentRef.Write(writer); Adapter1Ref.Write(writer); Adapter2Ref.Write(writer); Database1Ref.Write(writer); Database1.Write(writer); writer.Write(Database1Flag); Database2Ref.Write(writer); Database2.Write(writer); writer.Write(Database2Flag); }
public override void Write(OsiWriter writer) { base.Write(writer); LeftParentRef.Write(writer); RightParentRef.Write(writer); LeftAdapterRef.Write(writer); RightAdapterRef.Write(writer); LeftDatabaseRef.Write(writer); LeftDatabase.Write(writer); writer.Write(LeftDatabaseFlag); RightDatabaseRef.Write(writer); RightDatabase.Write(writer); writer.Write(RightDatabaseFlag); }
public override void Write(OsiWriter writer) { base.Write(writer); LeftParentRef.Write(writer); RightParentRef.Write(writer); LeftAdapterRef.Write(writer); RightAdapterRef.Write(writer); LeftDatabaseNodeRef.Write(writer); LeftDatabaseJoin.Write(writer); writer.Write(LeftDatabaseIndirection); RightDatabaseNodeRef.Write(writer); RightDatabaseJoin.Write(writer); writer.Write(RightDatabaseIndirection); }
public void Write(Stream stream, Story story) { using (Writer = new OsiWriter(stream)) { Writer.MajorVersion = story.MajorVersion; Writer.MinorVersion = story.MinorVersion; var header = new OsirisHeader(); header.Version = "Osiris save file dd. 02/10/15 12:44:13. Version 1.5."; header.MajorVersion = story.MajorVersion; header.MinorVersion = story.MinorVersion; header.BigEndian = false; header.Unused = 0; // Debug flags used in D:OS EE header.DebugFlags = 0x000CA010; header.Write(Writer); if (Writer.MajorVersion > 1 || (Writer.MajorVersion == 1 && Writer.MinorVersion > 7)) { var msg = String.Format( "Osiris version v{0}.{1} unsupported; this tool supports versions up to v1.7.", Writer.MajorVersion, Writer.MinorVersion ); throw new InvalidDataException(msg); } if (Writer.MajorVersion > 1 || (Writer.MajorVersion == 1 && Writer.MinorVersion >= 4)) { Writer.Scramble = 0xAD; } if (Writer.MajorVersion > 1 || (Writer.MajorVersion == 1 && Writer.MinorVersion >= 5)) { WriteTypes(story.Types); } Writer.WriteList(story.DivObjects); Writer.WriteList(story.Functions); WriteNodes(story.Nodes); WriteAdapters(story.Adapters); WriteDatabases(story.Databases); WriteGoals(story.Goals); Writer.WriteList(story.GlobalActions); } }
public void Write(OsiWriter writer) { writer.Write(Index); writer.Write(Name); writer.Write(SubGoalCombination); writer.WriteList <GoalReference>(ParentGoals); writer.WriteList <GoalReference>(SubGoals); writer.Write(Flags); if (writer.Ver >= OsiVersion.VerAddInitExitCalls) { writer.WriteList <Call>(InitCalls); writer.WriteList <Call>(ExitCalls); } }
public void Write(OsiWriter writer) { Constants.Write(writer); writer.Write((byte)LogicalIndices.Count); foreach (var index in LogicalIndices) { writer.Write(index); } writer.Write((byte)LogicalToPhysicalMap.Count); foreach (var pair in LogicalToPhysicalMap) { writer.Write(pair.Key); writer.Write(pair.Value); } }
public override void Write(OsiWriter writer) { base.Write(writer); writer.WriteList <Call>(Calls); writer.Write((byte)Variables.Count); foreach (var variable in Variables) { writer.Write((byte)1); variable.Write(writer); } writer.Write(Line); if (writer.MajorVersion > 1 || (writer.MajorVersion == 1 && writer.MinorVersion >= 6)) { writer.Write(IsQuery); } }
public override void Write(OsiWriter writer) { base.Write(writer); writer.WriteList <Call>(Calls); writer.Write((byte)Variables.Count); foreach (var variable in Variables) { writer.Write((byte)1); variable.Write(writer); } writer.Write(Line); if (writer.Ver >= OsiVersion.VerAddQuery) { writer.Write(IsQuery); } }
public void Write(OsiWriter writer) { writer.Write(Name); if (Name.Length > 0) { writer.Write(Parameters != null); if (Parameters != null) { writer.Write((byte)Parameters.Count); foreach (var param in Parameters) { writer.Write(param is Variable); param.Write(writer); } } writer.Write(Negate); } writer.Write(GoalIdOrDebugHook); }
public void Write(OsiWriter writer) { writer.Write((byte)0); writer.Write(Version); writer.Write(MajorVersion); writer.Write(MinorVersion); writer.Write(BigEndian); writer.Write(Unused); if (Ver >= OsiVersion.VerAddVersionString) { var versionString = String.Format("{0}.{1}", MajorVersion, MinorVersion); var versionBytes = Encoding.UTF8.GetBytes(versionString); byte[] version = new byte[0x80]; versionBytes.CopyTo(version, 0); writer.Write(version, 0, version.Length); } if (Ver >= OsiVersion.VerAddDebugFlags) { writer.Write(DebugFlags); } }
public void Write(Stream stream, Story story) { using (Writer = new OsiWriter(stream)) { foreach (var node in story.Nodes) { node.Value.PreSave(story); } Writer.MajorVersion = story.MajorVersion; Writer.MinorVersion = story.MinorVersion; var header = new SaveFileHeader(); if (Writer.Ver >= OsiVersion.VerExternalStringTable) { header.Version = "Osiris save file dd. 03/30/17 07:28:20. Version 1.8."; } else { header.Version = "Osiris save file dd. 02/10/15 12:44:13. Version 1.5."; } header.MajorVersion = story.MajorVersion; header.MinorVersion = story.MinorVersion; header.BigEndian = false; header.Unused = 0; // Debug flags used in D:OS EE and D:OS 2 header.DebugFlags = 0x000C10A0; header.Write(Writer); if (Writer.Ver > OsiVersion.VerLastSupported) { var msg = String.Format( "Osiris version v{0}.{1} unsupported; this tool supports saving up to version 1.11.", Writer.MajorVersion, Writer.MinorVersion ); throw new InvalidDataException(msg); } if (Writer.Ver >= OsiVersion.VerScramble) { Writer.Scramble = 0xAD; } if (Writer.Ver >= OsiVersion.VerAddTypeMap) { // Don't export builtin types, only externally declared ones var types = story.Types.Values.Where(t => !t.IsBuiltin).ToList(); WriteTypes(types); } // TODO: regenerate string table? if (Writer.Ver >= OsiVersion.VerExternalStringTable && Writer.Ver < OsiVersion.VerRemoveExternalStringTable) { WriteStrings(story.ExternalStringTable); } Writer.WriteList(story.DivObjects); Writer.WriteList(story.Functions); WriteNodes(story.Nodes); WriteAdapters(story.Adapters); WriteDatabases(story.Databases); WriteGoals(story.Goals); Writer.WriteList(story.GlobalActions); foreach (var node in story.Nodes) { node.Value.PostSave(story); } } }
public virtual void Write(OsiWriter writer) { // TODO: Is the == 0x31 case ever used when reading? writer.Write((byte)'0'); uint writtenTypeId = TypeId; bool aliased = false; uint alias; if (writer.TypeAliases.TryGetValue(TypeId, out alias)) { aliased = true; writtenTypeId = alias; } writer.Write(TypeId); if (writer.Ver < OsiVersion.VerEnhancedTypes) { // Make sure that we're serializing using the D:OS2 type ID // (The alias map contains the D:OS 1 ID) writtenTypeId = ConvertOS1ToOS2Type(writtenTypeId); } switch ((Type)writtenTypeId) { case Type.Unknown: break; case Type.Integer: writer.Write(IntValue); break; case Type.Integer64: // D:OS 1 aliased strings didn't have a flag byte if (writer.Ver >= OsiVersion.VerEnhancedTypes) { writer.Write(Int64Value); } else { writer.Write((int)Int64Value); } break; case Type.Float: writer.Write(FloatValue); break; case Type.String: case Type.GuidString: if (!aliased || (writer.Ver >= OsiVersion.VerEnhancedTypes)) { writer.Write(StringValue != null); } if (StringValue != null) { writer.Write(StringValue); } break; default: writer.Write(StringValue); break; } }
public override void Write(OsiWriter writer) { base.Write(writer); NextNode.Write(writer); }