コード例 #1
0
        public void Serialize(IO.BitStream s, GameEngineMegaloVariant megalo)
        {
            megalo.StreamStringTableIndexReference(s, ref NameStringIndex);
            megalo.StreamStringTableIndexReference(s, ref DescriptionStringIndex);
            s.Stream(ref IsRangeValue);
            if (IsRangeValue)
            {
                s.Stream(ref Value, 10, signExtend: true);
                // min, max
                if (s.IsReading)
                {
                    ValuesRead(s, megalo, 2, IsRangeValue);
                }
                else if (s.IsWriting)
                {
                    ValuesWrite(s, megalo, IsRangeValue);
                }
            }
            else
            {
                megalo.StreamUserDefinedValueIndex(s, ref DefaultValueIndex);
                if (s.IsReading)
                {
                    ValuesRead(s, megalo, TypeExtensions.kNone, IsRangeValue);
                }
                else if (s.IsWriting)
                {
                    int count = Values.Count;
                    megalo.StreamUserDefinedValuesCount(s, ref count);

                    ValuesWrite(s, megalo, IsRangeValue);
                }
            }
        }
コード例 #2
0
 public void Serialize(IO.BitStream s, GameEngineMegaloVariant megalo, bool isRangeValue)
 {
     s.Stream(ref Value, 10, signExtend: true);
     if (!isRangeValue)
     {
         megalo.StreamStringTableIndexReference(s, ref NameStringIndex);
         megalo.StreamStringTableIndexReference(s, ref DescriptionStringIndex);
     }
 }