Example #1
0
        public void Read(BinaryReader reader)
        {
            currentFileVersion = new Value <byte>(reader.ReadByte());
            currentState       = new Value <QuestState>((QuestState)reader.ReadByte());
            isTracked          = new Value <bool>(reader.ReadBoolean());
            finishTime         = new Value <ulong>(reader.ReadUInt64());

            //num
            int objectiveCount = reader.ReadByte();

            for (int i = 0; i < objectiveCount; i++)
            {
                BaseObjective baseObjective = new BaseObjective();
                baseObjective.Read(reader);
                objectives.Add(baseObjective);
            }

            //num2
            int dataVariableCount = reader.ReadByte();

            for (int j = 0; j < dataVariableCount; j++)
            {
                string key   = reader.ReadString();
                string value = reader.ReadString();
                dataVariables.Add(key, value);
            }
        }
Example #2
0
        public void Read(BinaryReader reader)
        {
            currentFileVersion = new Value <byte>(reader.ReadByte());
            currentState       = new Value <QuestState>((QuestState)reader.ReadByte());
            isTracked          = new Value <bool>(reader.ReadBoolean());
            finishTime         = new Value <ulong>(reader.ReadUInt64());

            //Issue 21, A16 added Current Phase.
            if (this.currentFileVersion.Get() > 1)
            {
                this.CurrentPhase = new Value <byte>(reader.ReadByte());
            }
            //num
            int objectiveCount = reader.ReadByte();

            for (int i = 0; i < objectiveCount; i++)
            {
                BaseObjective baseObjective = new BaseObjective();
                baseObjective.Read(reader);
                objectives.Add(baseObjective);
            }

            //num2
            int dataVariableCount = reader.ReadByte();

            for (int j = 0; j < dataVariableCount; j++)
            {
                string key   = reader.ReadString();
                string value = reader.ReadString();

                //Issue 17 reported on GitHub
                //https://github.com/Karlovsky120/7DaysProfileEditor/issues/17
                if (!this.dataVariables.ContainsKey(key))
                {
                    dataVariables.Add(key, value);
                }
            }
        }