示例#1
0
        void ParseTriggerScript <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
            where TDoc : class
            where TCursor : class
        {
//			s.SetSerializerInterface(this);

            var ts = new Phx.BTriggerSystem();

            ts.Serialize(s);
        }
        public void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
            where TDoc : class
            where TCursor : class
        {
            s.StreamAttribute("showInScoreboard", ref ShowInScoreboard);

            int streamed_count = s.StreamFixedArray("Param", ParameterArray);

            Util.MarkUnusedVariable(ref streamed_count);
        }
        protected override int ReadExplicitIndex <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s, BXmlSerializerInterface xs)
        {
            string name = null;

            Params.StreamDataName(s, ref name);

            int index = mList.TypeValuesParams.kGetProtoEnumFromDB(xs.Database).GetMemberId(name);

            return(index);
        }
示例#4
0
        public void StreamTriggerScript <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s, StreamTriggerScriptContext ctxt)
            where TDoc : class
            where TCursor : class
        {
            s.SetSerializerInterface(this);

            var ts = ctxt.Script = new Phx.BTriggerSystem();

            ts.Serialize(s);
        }
示例#5
0
 public static void StreamAttributeOptUnchanged <TDoc, TCursor>(this IO.TagElementStream <TDoc, TCursor, string> s,
                                                                string name, ref int value)
     where TDoc : class
     where TCursor : class
 {
     if (!s.StreamAttributeOpt(name, ref value, TypeExtensionsBlam.kNotUnchanged32) && s.IsReading)
     {
         value = TypeExtensionsBlam.kUnchanged;
     }
 }
示例#6
0
 public void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
     where TDoc : class
     where TCursor : class
 {
     s.StreamAttributeEnumOpt("LeftRumbleType", ref mLeftRumbleType, e => e != BRumbleType.None);
     s.StreamAttributeEnumOpt("RightRumbleType", ref mRightRumbleType, e => e != BRumbleType.None);
     s.StreamAttributeOpt("Duration", ref mDuration, Predicates.IsNotZero);
     s.StreamAttributeOpt("LeftStrength", ref mLeftStrength, Predicates.IsNotZero);
     s.StreamAttributeOpt("RightStrength", ref mRightStrength, Predicates.IsNotZero);
 }
示例#7
0
 protected virtual void SerializeTimes <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
     where TDoc : class
     where TCursor : class
 {
     s.StreamAttributeOpt("respawn", ref RespawnTime /*, v=>v!=5*/);            // #HACK_BLAM: default respawn times differ in Reach and H4, so leaving predicate out for now
     s.StreamAttributeOpt("suicide", ref SuicideTime, v => v != TypeExtensionsBlam.kUsualDefaultRespawnTimeInSeconds);
     s.StreamAttributeOpt("betrayal", ref BetrayalTime, v => v != TypeExtensionsBlam.kUsualDefaultRespawnTimeInSeconds);
     s.StreamAttributeOpt("respawnGrowth", ref RespawnGrowthTime, Predicates.IsNotZero);
     s.StreamAttributeOpt("initialLoadoutSelection", ref InitialLoadoutSelectionTime, v => v != 10);
 }
示例#8
0
		void Preload<TDoc, TCursor>(IO.TagElementStream<TDoc, TCursor, string> s)
			where TDoc : class
			where TCursor : class
		{
			mIsPreloaded = false;

			Serialize(s);

			mIsPreloaded = true;
		}
        public void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
            where TDoc : class
            where TCursor : class
        {
            var xs = s.GetSerializerInterface();

            s.StreamAttribute("count", ref mCount);
            s.StreamAttributeEnumOpt("role", ref mUnitRole, e => e != BUnitRole.Normal);
            xs.StreamDBID(s, XML.XmlUtil.kNoXmlName, ref mUnitID, DatabaseObjectKind.Object, false, XML.XmlUtil.kSourceCursor);
        }
示例#10
0
        public void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
            where TDoc : class
            where TCursor : class
        {
            var variant = (GameEngineMegaloVariant)s.Owner;

            variant.SerializeStringTableIndex(s, "nameIndex", ref NameStringIndex);
            variant.SerializeStringTableIndex(s, "descIndex", ref DescriptionStringIndex);
            SerializeValue(s);
        }
 public void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
     where TDoc : class
     where TCursor : class
 {
     s.StreamAttributeOpt("rating", ref mRating, PhxPredicates.IsNotOne);
     s.StreamCursor(ref mDamagePercentage);
     s.StreamAttributeOpt("reflectDamageFactor", ref mReflectDamageFactor, Predicates.IsNotZero);
     s.StreamAttributeOpt("bowlable", ref mBowlable, Predicates.IsTrue);
     s.StreamAttributeOpt("rammable", ref mRammable, Predicates.IsTrue);
 }
示例#12
0
 internal void SerializeValues <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
     where TDoc : class
     where TCursor : class
 {
     using (s.EnterCursorBookmark(kValuesElementName))
     {
         s.StreamAttribute("defaultIndex", ref DefaultValueIndex);
         s.StreamableElements("entry", Values);
     }
 }
示例#13
0
 public override void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
 {
     using (s.EnterUserDataBookmark(this))
     {
         XML.XmlUtil.Serialize(s, Weapons, BWeapon.kBListXmlParams);
         //XML.XmlUtil.Serialize(s, TacticStates, BTacticState.kBListXmlParams);
         XML.XmlUtil.Serialize(s, Actions, BProtoAction.kBListXmlParams);
         Tactic.Serialize(s);
     }
 }
示例#14
0
        protected override void Read <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s, BXmlSerializerInterface xs, int iteration)
        {
            int index = ReadExplicitIndex(s, xs);

            ListExplicitIndex.InitializeItem(index);
            T data = new T();

            data.Serialize(s);
            ListExplicitIndex[index] = data;
        }
示例#15
0
 public void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
     where TDoc : class
     where TCursor : class
 {
     s.StreamCursor(ref mName);
     s.StreamAttribute("ikRange", ref mIKRange);
     s.StreamAttribute("linkCount", ref mLinkCount);
     s.StreamAttributeOpt("x", ref mAxisPositioning.X, Predicates.IsNotZero);
     s.StreamAttributeOpt("z", ref mAxisPositioning.Z, Predicates.IsNotZero);
 }
        protected override void Read <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s, BXmlSerializerInterface xs, int iteration)
        {
            int index = ReadExplicitIndex(s, xs);

            ListExplicitIndex.InitializeItem(index);
            float value = 0;

            s.ReadAttribute(kAttrName, ref value);
            ListExplicitIndex[index] = value;
        }
示例#17
0
 void NameOverridesToStream <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
     where TDoc : class
     where TCursor : class
 {
     foreach (var kv in mNameOverrides)
     {
         using (s.EnterCursorBookmark(kNameOverrideElementName))
             MegaloScriptProtoParam.SigIdNamePairToStream(s, kv);
     }
 }
示例#18
0
 protected virtual void WriteNodes <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s, BXmlSerializerInterface xs)
     where TDoc : class
     where TCursor : class
 {
     foreach (T data in List)
     {
         using (s.EnterCursorBookmark(WriteGetElementName(data)))
             Write(s, xs, data);
     }
 }
示例#19
0
        public override void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
        {
            base.Serialize(s);

            using (var bm = s.EnterCursorBookmarkOpt("WeaponSkins", this, obj => !obj.WeaponSkinsAreUnchanged)) if (bm.IsNotNull)
                {
                    s.StreamAttributeOpt("primary", ref PrimaryWeaponSkin, Predicates.IsNotZero);
                    s.StreamAttributeOpt("secondary", ref SecondaryWeaponSkin, Predicates.IsNotZero);
                }
        }
示例#20
0
        protected virtual void SerializeOverrides <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
            where TDoc : class
            where TCursor : class
        {
            s.StreamAttributeOpt("primaryColor", ref PrimaryColorOverride, v => v != uint.MaxValue, NumeralBase.Hex);
            s.StreamAttributeOpt("secondaryColor", ref SecondaryColorOverride, v => v != uint.MaxValue, NumeralBase.Hex);
            s.StreamAttributeOpt("textColor", ref TextColorOverride, v => v != uint.MaxValue, NumeralBase.Hex);

            s.StreamAttributeEnumOpt("model", ref ModelOverride, e => e != GameOptionsSingleTeamModelOverride.Spartan);
        }
示例#21
0
        public void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
            where TDoc : class
            where TCursor : class
        {
            var xs = s.GetSerializerInterface();

            s.StreamAttribute("IconLocation", ref mIconLocation);

            xs.StreamDBID(s, "Power", SupportPowerIDs, DatabaseObjectKind.Power, isOptional: false, xmlSource: XML.XmlUtil.kSourceCursor);
        }
示例#22
0
        public override void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
        {
            SanityCheckInvalidIsFalse(s.StreamName);
            base.Serialize(s);

            using (s.EnterCursorBookmark("GameVariant"))
            {
                s.StreamObject(Data);
            }
        }
示例#23
0
 public static void StreamAttributeOptNoneOption <TDoc, TCursor>(this IO.TagElementStream <TDoc, TCursor, string> s,
                                                                 string name, ref int value)
     where TDoc : class
     where TCursor : class
 {
     if (!s.StreamAttributeOpt(name, ref value, Predicates.IsNotNone) && s.IsReading)
     {
         value = KSoft.TypeExtensions.kNone;
     }
 }
示例#24
0
 public void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
     where TDoc : class
     where TCursor : class
 {
     s.StreamAttributeOpt("weight", ref Weight, Predicates.IsNotZero);
     if (!s.StreamAttributeOpt("name", ref Name, Predicates.IsNotNullOrEmpty))
     {
         Name = "";
     }
 }
示例#25
0
 public static void StreamAttributeOptUnchangedZero <TDoc, TCursor>(this IO.TagElementStream <TDoc, TCursor, string> s,
                                                                    string name, ref int value)
     where TDoc : class
     where TCursor : class
 {
     if (!s.StreamAttributeOpt(name, ref value, Predicates.IsNotZero) && s.IsReading)
     {
         value = 0;
     }
 }
示例#26
0
        public override void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
        {
            base.Serialize(s);

            s.StreamAttributeOptUnchangedZero("headshotImmunity", ref HeadshotImmunity);
            s.StreamAttributeOptUnchangedZero("assassinationImmunity", ref AssassinationImmunity);
            s.StreamAttributeOptUnchangedZero("deathless", ref Deathless);
            s.StreamAttributeOptUnchangedZero("fastTrackArmor", ref FastTrackArmor);
            s.StreamAttributeOptUnchangedZero("powerupCancellation", ref PowerupCancellation);
        }
示例#27
0
        internal static void SerializeWithContext <TDoc, TCursor, TContext>(IO.TagElementStream <TDoc, TCursor, string> s,
                                                                            TContext _unused,
                                                                            ref EngineBuildHandle value)
            where TDoc : class
            where TCursor : class
        {
            Util.MarkUnusedVariable(ref _unused);

            Serialize(s, ref value);
        }
示例#28
0
        public void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
            where TDoc : class
            where TCursor : class
        {
            var td = KSoft.Debug.TypeCheck.CastReference <BTacticData>(s.UserData);

            XML.XmlUtil.Serialize(s, TargetRules, BTacticTargetRule.kBListXmlParams);
            s.StreamElements("PersistentAction", PersistentActions, td, BTacticData.StreamProtoActionID);
            s.StreamElements("PersistentSquadAction", PersistentSquadActions, td, BTacticData.StreamProtoActionID);
        }
        internal static void SigIdNamePairToStream <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s,
                                                                   KeyValuePair <int, string> pair)
            where TDoc : class
            where TCursor : class
        {
            int key = pair.Key; string value = pair.Value;

            s.StreamAttribute(kSigIdAttributeName, ref key);
            s.StreamAttribute(kNameAttirbuteName, ref key);
        }
        public void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s)
            where TDoc : class
            where TCursor : class
        {
            var xs = s.GetSerializerInterface();

            xs.StreamDBID(s, XML.XmlUtil.kNoXmlName, ref mDamageType, DatabaseObjectKind.DamageType, isOptional: false, xmlSource: XML.XmlUtil.kSourceCursor);
            s.StreamAttributeEnum("direction", ref mDirection);
            s.StreamAttributeEnumOpt("mode", ref mMode, e => e != BSquadMode.Normal);
        }