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); }
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); }
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; } }
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); }
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); }
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); }
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); }
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); } }
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); } }
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; }
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; }
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); } }
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); } }
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); } }
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); }
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); }
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); } }
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; } }
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 = ""; } }
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; } }
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); }
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); }
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); }