Beispiel #1
0
        public static void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s,
                                                     Collections.BTypeValuesSingle list, BTypeValuesXmlParams <float> @params,
                                                     string attrName = null)
            where TDoc : class
            where TCursor : class
        {
            Contract.Requires(s != null);
            Contract.Requires(list != null);
            Contract.Requires(@params != null);

            BTypeValuesXmlSerializerBase <float> xs;

            if (attrName == null)
            {
                xs = new BTypeValuesSingleXmlSerializer(@params, list);
            }
            else
            {
                xs = new BTypeValuesSingleAttrHackXmlSerializer(@params, list, attrName);
            }

            using (xs)
            {
                xs.Serialize(s);
            }
        }
Beispiel #2
0
        public static void Serialize(KSoft.IO.XmlElementStream s, FA mode, BXmlSerializerInterface xsi,
                                     Collections.BTypeValuesSingle list, BTypeValuesXmlParams <float> @params,
                                     string attr_name = null)
        {
            Contract.Requires(s != null);
            Contract.Requires(xsi != null);
            Contract.Requires(list != null);
            Contract.Requires(@params != null);

            BTypeValuesXmlSerializerBase <float> xs;

#if NO_TLS_STREAMING
            if (attr_name == null)
            {
                xs = new BTypeValuesSingleXmlSerializer(@params, list);
            }
            else
            {
                xs = new BTypeValuesSingleAttrHackXmlSerializer(@params, list, attr_name);
            }
#else
            if (attr_name == null)
            {
                xs = BDatabaseXmlSerializerBase.sBTypeValuesSingleXmlSerializer.Value.Reset(@params, list);
            }
            else
            {
                xs = BDatabaseXmlSerializerBase.sBTypeValuesSingleAttrHackXmlSerializer.Value.Reset(@params, list, attr_name);
            }
#endif
            using (xs)
            {
                xs.StreamXml(s, mode, xsi);
            }
        }
Beispiel #3
0
        protected DatabasePurchasableObject(Collections.BTypeValuesParams <float> rsrc_cost_params, XML.BTypeValuesXmlParams <float> rsrc_cost_xml_params)
        {
            mResourceCostXmlParams = rsrc_cost_xml_params;

            ResourceCost = new Collections.BTypeValuesSingle(rsrc_cost_params);

            mBuildTime = mResearchTime = Util.kGetInvalidSingle();
        }
Beispiel #4
0
        public BLeader()
        {
            Resources = new Collections.BTypeValuesSingle(BResource.kBListTypeValuesParams);

            StartingSquads = new Collections.BListOfIDs();

            Populations = new Collections.BTypeValues <BPopulation>(BPopulation.kBListParams);
        }
Beispiel #5
0
        public BCostTypeValuesSingleAttrHackXmlSerializer Reset(Collections.BTypeValuesSingle list)
        {
            Contract.Requires <ArgumentNullException>(list != null);

            base.Reset(kParams);
            mList = list;

            return(this);
        }
Beispiel #6
0
        public BProtoObject() : base(BResource.kBListTypeValuesParams, BResource.kBListTypeValuesXmlParams_Cost)
        {
            Veterancy = new Collections.BListExplicitIndex <BProtoObjectVeterancy>(BProtoObjectVeterancy.kBListExplicitIndexParams);

            Populations            = new Collections.BTypeValuesSingle(BPopulation.kBListParamsSingle);
            PopulationsCapAddition = new Collections.BTypeValuesSingle(BPopulation.kBListParamsSingle);

            Rates       = new Collections.BTypeValuesSingle(BGameData.kRatesBListTypeValuesParams);
            AddResource = new Collections.BTypeValuesSingle(BResource.kBListTypeValuesParams);

            Flags       = new Collections.BBitSet(kFlagsParams);
            ObjectTypes = new Collections.BBitSet(kObjectTypesParams);
        }
Beispiel #7
0
        public static void SerializeCostHack <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s,
                                                             Collections.BTypeValuesSingle list)
            where TDoc : class
            where TCursor : class
        {
            Contract.Requires(s != null);
            Contract.Requires(list != null);

            using (var xs = new BCostTypeValuesSingleAttrHackXmlSerializer(list))
            {
                xs.Serialize(s);
            }
        }
Beispiel #8
0
        public BLeader()
        {
            var textData = base.CreateDatabaseObjectUserInterfaceTextData();

            textData.HasNameID        = true;
            textData.HasDescriptionID = true;

            SupportPowers      = new Collections.BListArray <BLeaderSupportPower>();
            StartingSquads     = new Collections.BListArray <BLeaderStartingSquad>();
            StartingUnits      = new Collections.BListArray <BLeaderStartingUnit>();
            RepairCost         = new Collections.BTypeValuesSingle(BResource.kBListTypeValuesParams);
            ReverseHotDropCost = new Collections.BTypeValuesSingle(BResource.kBListTypeValuesParams);
            Populations        = new Collections.BTypeValues <BPopulation>(BPopulation.kBListParams);
            Resources          = new Collections.BTypeValuesSingle(BResource.kBListTypeValuesParams);
        }
Beispiel #9
0
        public static void SerializeCostHack(KSoft.IO.XmlElementStream s, FA mode, BXmlSerializerInterface xsi,
                                             Collections.BTypeValuesSingle list)
        {
            Contract.Requires(s != null);
            Contract.Requires(xsi != null);
            Contract.Requires(list != null);

            using (var xs =
#if NO_TLS_STREAMING
                       new BCostTypeValuesSingleAttrHackXmlSerializer(list)
#else
                       BDatabaseXmlSerializerBase.sBCostTypeValuesSingleAttrHackXmlSerializer.Value.Reset(list)
#endif
                   )
            {
                xs.StreamXml(s, mode, xsi);
            }
        }
        public BProtoPower()
        {
            var textData = base.CreateDatabaseObjectUserInterfaceTextData();

            textData.HasDisplayNameID  = true;
            textData.HasRolloverTextID = true;
            textData.HasPrereqTextID   = true;
            textData.HasChooseTextID   = true;

            Cost                = new Collections.BTypeValuesSingle(BResource.kBListTypeValuesParams);
            DynamicCosts        = new Collections.BListArray <BPowerDynamicCost>();
            TargetEffectiveness = new Collections.BListArray <BPowerTargetEffectiveness>();
            Populations         = new Collections.BTypeValuesSingle(BPopulation.kBListParamsSingle);

            Flags  = new Collections.BBitSet(kFlagsParams);
            Flags2 = new Collections.BBitSet(kFlags2Params);

            IconLocations = new List <int>();
            TechPrereqs   = new List <int>();

            ChildObjectIDs = new List <int>();
            LevelData      = new Collections.BListExplicitIndex <BProtoPowerDataLevel>(BProtoPowerDataLevel.kBListExplicitIndexParams);
        }
        public BTypeValuesSingleAttrHackXmlSerializer(BTypeValuesXmlParams <float> @params, Collections.BTypeValuesSingle list, string attributeName)
            : base(@params, list)
        {
            Contract.Requires <ArgumentNullException>(@params != null);
            Contract.Requires <ArgumentNullException>(list != null);
            Contract.Requires <ArgumentNullException>(attributeName != null);

            kAttrName = attributeName;
        }
Beispiel #12
0
        public BProtoPower()
        {
            Cost = new Collections.BTypeValuesSingle(BResource.kBListTypeValuesParams);

            Populations = new Collections.BTypeValuesSingle(BPopulation.kBListParamsSingle);
        }
Beispiel #13
0
 public BCostTypeValuesSingleAttrHackXmlSerializer(Collections.BTypeValuesSingle list) : base(kParams)
 {
     mList = list;
 }
        protected DatabasePurchasableObject(Collections.BTypeValuesParams <float> rsrcCostParams, XML.BTypeValuesXmlParams <float> rsrcCostXmlParams)
        {
            mResourceCostXmlParams = rsrcCostXmlParams;

            ResourceCost = new Collections.BTypeValuesSingle(rsrcCostParams);
        }
Beispiel #15
0
        public BTypeValuesSingleXmlSerializer Reset(BTypeValuesXmlParams <float> @params, Collections.BTypeValuesSingle list)
        {
            Contract.Requires <ArgumentNullException>(@params != null);
            Contract.Requires <ArgumentNullException>(list != null);

            base.Reset(@params, list);

            return(this);
        }
Beispiel #16
0
 protected override void FinishTlsStreaming()
 {
     base.FinishTlsStreaming();
     mList = null;
 }
Beispiel #17
0
        public BTypeValuesSingleAttrHackXmlSerializer Reset(BTypeValuesXmlParams <float> @params, Collections.BTypeValuesSingle list, string attr_name)
        {
            Contract.Requires <ArgumentNullException>(@params != null);
            Contract.Requires <ArgumentNullException>(list != null);
            Contract.Requires <ArgumentNullException>(attr_name != null);

            base.Reset(@params, list);
            kAttrName = attr_name;

            return(this);
        }