Ejemplo n.º 1
1
        public void Deserialize(IPofReader reader)
        {
            var version = reader.ReadU32(0);
             Id = reader.ReadGuid(1);
             Name = reader.ReadString(2);
             Authors = reader.ReadArray<string>(3);
             Website = reader.ReadString(4);
             Targets = reader.ReadArray<uint>(5).Select(GameType.FromValue).ToArray();

             Trace.Assert(version == kVersion);
        }
 public void ReadExternal(IPofReader reader)
 {
     m_oArray             = (object[])reader.ReadArray(0, new Object[0]);
     m_sArray             = (String[])reader.ReadArray(1, new String[0]);
     m_col                = (IList)reader.ReadCollection(2, new ArrayList());
     m_colUniform         = (IList)reader.ReadCollection(3, new ArrayList());
     m_sparseArray        = reader.ReadLongArray(4, new LongSortedList());
     m_uniformSparseArray = reader.ReadLongArray(5, new LongSortedList());
 }
Ejemplo n.º 3
0
        public void Deserialize(IPofReader reader)
        {
            var version = reader.ReadU32(0);

            Id      = reader.ReadGuid(1);
            Name    = reader.ReadString(2);
            Authors = reader.ReadArray <string>(3);
            Website = reader.ReadString(4);
            Targets = reader.ReadArray <uint>(5).Select(GameType.FromValue).ToArray();

            Trace.Assert(version == kVersion);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Restore the contents of a user type instance by reading its state
 /// using the specified <see cref="IPofReader"/> object.
 /// </summary>
 /// <param name="reader">
 /// The <b>IPofReader</b> from which to read the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public override void ReadExternal(IPofReader reader)
 {
     m_fetchExtractor = reader.ReadBoolean(0);
     m_query          = reader.ReadString(1);
     m_env            = (object[])reader.ReadArray(2, null);
     m_bindings       = (IDictionary)reader.ReadDictionary(3, null);
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Restore the contents of a user type instance by reading its state
        /// using the specified <see cref="IPofReader"/> object.
        /// </summary>
        /// <param name="reader">
        /// The <b>IPofReader</b> from which to read the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public virtual void ReadExternal(IPofReader reader)
        {
            m_memberName = reader.ReadString(0);

            int paramCount = reader.ReadInt32(1);

            // slot #1 is taken by pre-Coherence 3.5 versions for the number
            // of arguments in the parameter array
            if (paramCount > 0)
            {
                // fully backwards compatible implementation
                Object[] parameters = new Object[paramCount];
                for (int i = 0; i < paramCount; i++)
                {
                    parameters[i] = reader.ReadObject(i + 2);
                }
                m_parameters = parameters;
            }
            else
            {
                // slot #2 is used since Coherence 3.5 to store the entirety
                // of the arguments (as opposed to the first of the arguments)
                m_parameters = (object[])reader.ReadArray(2);
                m_target     = reader.ReadInt32(3);
            }
        }
        public void ReadExternal(IPofReader reader)
        {
            Assert.AreEqual(INTEGER, reader.ReadInt32(0));
            IPofReader nested1 = reader.CreateNestedPofReader(1);

            IPofReader nested2 = nested1.CreateNestedPofReader(0);

            Assert.AreEqual(STRING, nested2.ReadString(0));
            var person2 = (PortablePerson)nested2.ReadObject(1);

            double[] doubleArray = nested2.ReadDoubleArray(2);
            Assert.AreEqual(ArrayEqual(DOUBLE_ARRAY, doubleArray), true);

            IPofReader nested3     = nested2.CreateNestedPofReader(3);
            var        stringArray = (String[])nested3.ReadArray(0, new String[0]);

            Assert.IsTrue(ArrayEqual(stringArray, STRING_ARRAY));
            nested3.ReadRemainder();

            // close nested3 and continue to nested2
            bool boolVal = nested2.ReadBoolean(4);

            Assert.AreEqual(false, boolVal);

            // nested1
            ICollection          col     = nested1.ReadCollection(1, null);
            ICollection <String> results = new Collection <String>();

            foreach (object res in col)
            {
                results.Add((string)res);
            }
            foreach (String val in set)
            {
                Assert.IsTrue(results.Contains(val));
            }

            Assert.AreEqual(2.0, nested1.ReadDouble(2));
            Assert.AreEqual(5, nested1.ReadInt32(3));

            results = nested1.ReadCollection(4, results);
            foreach (String val in set)
            {
                Assert.IsTrue(results.Contains(val));
            }

            var person1 = (PortablePerson)nested1.ReadObject(5);

            Assert.AreEqual(2.222, nested1.ReadDouble(10));

            nested1.ReadRemainder();

            Assert.AreEqual(4.444, reader.ReadDouble(2));
            Assert.AreEqual(15, reader.ReadInt32(3));
            var person = (PortablePerson)reader.ReadObject(4);

            Assert.IsTrue(person == person1);
            Assert.IsTrue(person1 == person2);
        }
Ejemplo n.º 7
0
            public void Deserialize(IPofReader reader)
            {
                int i = 0;

                key     = reader.ReadObject <PersonKey>(i++);
                level   = reader.ReadS32(i++);
                friends = new List <PersonFriend>(reader.ReadArray <PersonFriend>(i++));
            }
Ejemplo n.º 8
0
        /// <summary>
        /// Restore the contents of a user type instance by reading its state
        /// using the specified <see cref="IPofReader"/> object.
        /// </summary>
        /// <param name="reader">
        /// The <b>IPofReader</b> from which to read the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public virtual void ReadExternal(IPofReader reader)
        {
            m_filters = (IFilter[])reader.ReadArray(0, EMPTY_FILTER_ARRAY);

            // if we read an old version of the filter that didn't have this field,
            // it would result in maintaining the old behavior
            m_preserveOrder = reader.ReadBoolean(1);
        }
 public void Deserialize(IPofReader reader) {
    packetId = reader.ReadS32(0);
    leftX = reader.ReadFloat(1);
    leftY = reader.ReadFloat(2);
    rightX = reader.ReadFloat(3);
    rightY = reader.ReadFloat(4);
    leftTrigger = reader.ReadFloat(5);
    rightTrigger = reader.ReadFloat(6);
    buttons = reader.ReadArray<bool>(7);
 }
Ejemplo n.º 10
0
 public void Deserialize(IPofReader reader)
 {
     packetId     = reader.ReadS32(0);
     leftX        = reader.ReadFloat(1);
     leftY        = reader.ReadFloat(2);
     rightX       = reader.ReadFloat(3);
     rightY       = reader.ReadFloat(4);
     leftTrigger  = reader.ReadFloat(5);
     rightTrigger = reader.ReadFloat(6);
     buttons      = reader.ReadArray <bool>(7);
 }
 public void ReadExternal(IPofReader reader)
 {
     setList1((IList)reader.ReadCollection(0, null));
     setList2((IList)reader.ReadCollection(1, new ArrayList()));
     setList3((IList)reader.ReadCollection(2, null));
     setMap1(reader.ReadDictionary(3, null));
     setMap2(reader.ReadDictionary(4, new Hashtable()));
     setMap3(reader.ReadDictionary(5, null));
     setNumber(reader.ReadInt32(6));
     setText(reader.ReadString(7));
     setChildren((PofChild[])reader.ReadArray(8, new PofChild[0]));
 }
 protected override void Deserialize(IPofReader reader, int baseSlot) {
    EpochId = reader.ReadGuid(baseSlot + 0);
    OrderedParticipants = reader.ReadArray<Guid>(baseSlot + 1);
 }
 /// <summary>
 /// Restore the contents of a user type instance by reading its state
 /// using the specified <see cref="IPofReader"/> object.
 /// </summary>
 /// <param name="reader">
 /// The <b>IPofReader</b> from which to read the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public virtual void ReadExternal(IPofReader reader)
 {
     m_processors = (IEntryProcessor[])reader.ReadArray(0, EMPTY_PROCESSOR_ARRAY);
 }
Ejemplo n.º 14
0
 protected override void Deserialize(IPofReader reader, int baseSlot) {
    Blocks = reader.ReadArray<PartitionBlockInterval>(baseSlot + 0);
 }
 /// <summary>
 /// Restore the contents of a user type instance by reading its state
 /// using the specified <see cref="IPofReader"/> object.
 /// </summary>
 /// <param name="reader">
 /// The <b>IPofReader</b> from which to read the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public virtual void ReadExternal(IPofReader reader)
 {
     m_extractors = (IValueExtractor[])reader.ReadArray(0, EMPTY_EXTRACTOR_ARRAY);
 }
Ejemplo n.º 16
0
 public void Deserialize(IPofReader reader)
 {
     alsoTime = reader.ReadObject(0);
     time     = reader.ReadDateTime(1);
     times    = reader.ReadArray <DateTime>(2);
 }
 /// <summary>
 /// Restore the contents of a user type instance by reading its state
 /// using the specified <see cref="IPofReader"/> object.
 /// </summary>
 /// <param name="reader">
 /// The <b>IPofReader</b> from which to read the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public virtual void ReadExternal(IPofReader reader)
 {
     m_aggregators = (IParallelAwareAggregator[])reader.ReadArray(0, EMPTY_AGGREGATOR_ARRAY);
 }
 /// <summary>
 /// Restore the contents of a user type instance by reading its state
 /// using the specified <see cref="IPofReader"/> object.
 /// </summary>
 /// <param name="reader">
 /// The <b>IPofReader</b> from which to read the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public virtual void ReadExternal(IPofReader reader)
 {
     m_comparers = (IComparer[])reader.ReadArray(0);
 }
 public void Deserialize(IPofReader reader)
 {
     value = reader.ReadArray <object>(1, true);
 }
Ejemplo n.º 20
0
 public void Deserialize(IPofReader reader)
 {
     ReturnValue  = reader.ReadObject(0);
     OutRefValues = reader.ReadArray <object>(1, true);
 }