コード例 #1
0
        public BTriggerSystem()
        {
            Groups = new Collections.BListAutoId <BTriggerGroup>();

            Vars     = new Collections.BListAutoId <BTriggerVar>();
            Triggers = new Collections.BListAutoId <BTrigger>();
        }
コード例 #2
0
 public TriggerDatabase()
 {
     Conditions  = new Collections.BListAutoId <BTriggerProtoCondition>();
     Effects     = new Collections.BListAutoId <BTriggerProtoEffect>();
     LookupTable = new Dictionary <uint, TriggerSystemProtoObject>();
     mUsedIds    = new System.Collections.BitArray(1088);
 }
コード例 #3
0
		public BListAutoIdXmlSerializer(BListXmlParams @params, Collections.BListAutoId<T> list)
		{
			Contract.Requires<ArgumentNullException>(@params != null);
			Contract.Requires<ArgumentNullException>(list != null);

			mParams = @params;
			mList = list;
		}
コード例 #4
0
        internal static string TryGetName <T>(Collections.BListAutoId <T> dbi, int id)
            where T : class, Collections.IListAutoIdObject, new()
        {
            if (id >= 0 && id < dbi.Count)
            {
                return(dbi[id].Data);
            }

            return(null);
        }
コード例 #5
0
		public static IBListAutoIdXmlSerializer CreateXmlSerializer<T>(Collections.BListAutoId<T> list, BListXmlParams @params)
			where T : class, Collections.IListAutoIdObject, new()
		{
			Contract.Requires(list != null);
			Contract.Requires(@params != null);

			var xs = new BListAutoIdXmlSerializer<T>(@params, list);

			return xs;
		}
コード例 #6
0
        static void BuildDictionary <T>(out Dictionary <int, T> dic, Collections.BListAutoId <T> list)
            where T : TriggerScriptIdObject, new()
        {
            dic = new Dictionary <int, T>(list.Count);

            foreach (var item in list)
            {
                dic.Add(item.ID, item);
            }
        }
コード例 #7
0
        public BTacticData(string name)
        {
            Contract.Requires(!string.IsNullOrEmpty(name));

            Name = name;

            Weapons = new Collections.BListAutoId <BWeapon>();
            Actions = new Collections.BListAutoId <BProtoAction>();

            Tactic = new BTactic();

            InitializeDatabaseInterfaces();
        }
コード例 #8
0
        public HPBarData()
        {
            ObjectDatabase = new ProtoDataObjectDatabase(this, typeof(HPBarDataObjectKind));

            HPBars            = new Collections.BListAutoId <BProtoHPBar>();
            ColorStages       = new Collections.BListAutoId <BProtoHPBarColorStages>();
            VeterancyBars     = new Collections.BListAutoId <BProtoVeterancyBar>();
            PieProgress       = new Collections.BListAutoId <BProtoPieProgress>();
            BobbleHeads       = new Collections.BListAutoId <BProtoBobbleHead>();
            BuildingStrengths = new Collections.BListAutoId <BProtoBuildingStrength>();

            InitializeDatabaseInterfaces();
        }
コード例 #9
0
        internal static int TryGetId <T>(Dictionary <string, T> dbi, string name, Collections.BListAutoId <T> _unused)
            where T : class, Collections.IListAutoIdObject, new()
        {
            int id = Util.kInvalidInt32;

            T obj;

            if (dbi.TryGetValue(name, out obj))
            {
                id = obj.AutoID;
            }

            return(id);
        }
コード例 #10
0
        public static IBListAutoIdXmlSerializer CreateXmlSerializer <T>(Collections.BListAutoId <T> list, BListXmlParams @params)
            where T : class, Collections.IListAutoIdObject, new()
        {
            Contract.Requires(list != null);
            Contract.Requires(@params != null);

            var xs =
#if NO_TLS_STREAMING
                new BListAutoIdXmlSerializer <T>(@params, list);
#else
                BDatabaseXmlSerializerBase._BListAutoId <T> .sXmlSerializer.Value.Reset(@params, list);
#endif

            return(xs);
        }
コード例 #11
0
		public static void Serialize<T, TDoc, TCursor>(IO.TagElementStream<TDoc, TCursor, string> s,
			Collections.BListAutoId<T> list, BListXmlParams @params, bool forceNoRootElementStreaming = false)
			where T : class, Collections.IListAutoIdObject, new()
			where TDoc : class
			where TCursor : class
		{
			Contract.Requires(s != null);
			Contract.Requires(list != null);
			Contract.Requires(@params != null);

			if (forceNoRootElementStreaming) @params.SetForceNoRootElementStreaming(true);
			using (var xs = CreateXmlSerializer(list, @params))
			{
				xs.Serialize(s);
			}
			if (forceNoRootElementStreaming) @params.SetForceNoRootElementStreaming(false);
		}
コード例 #12
0
		public BGameData()
		{
			Resources = new Collections.BListAutoId<BResource>();
			Rates = new Collections.BTypeNames();
			Populations = new Collections.BTypeNames();
			RefCounts = new Collections.BTypeNames();
			#region Nonsense
			HUDItems = new Collections.BTypeNames();
			FlashableItems = new Collections.BTypeNames();
			UnitFlags = new Collections.BTypeNames();
			SquadFlags = new Collections.BTypeNames();
			#endregion
			CodeProtoObjects = new Collections.BTypeValuesString(kCodeProtoObjectsParams);
			CodeObjectTypes = new Collections.BTypeValuesString(kCodeObjectTypesParams);

			InfectionMap = new Collections.BListArray<BInfectionMap>();

			PlayerStates = new Collections.BTypeNames();
		}
コード例 #13
0
        protected BDatabaseBase(PhxEngine engine, Collections.IProtoEnum game_object_types)
        {
            Engine = engine;

            StringTable = new Dictionary <int, string>();

            GameData    = new BGameData();
            DamageTypes = new Collections.BListAutoId <BDamageType>();
            WeaponTypes = new Collections.BListAutoId <BWeaponType>();
            UserClasses = new Collections.BListAutoId <BUserClass>();
            ObjectTypes = new Collections.BTypeNamesWithCode(game_object_types);
            Abilities   = new Collections.BListAutoId <BAbility>();
            Objects     = new Collections.BListAutoId <BProtoObject>();
            Squads      = new Collections.BListAutoId <BProtoSquad>();
            Powers      = new Collections.BListAutoId <BProtoPower>();
            Techs       = new Collections.BListAutoId <BProtoTech>();
            Civs        = new Collections.BListAutoId <BCiv>();
            Leaders     = new Collections.BListAutoId <BLeader>();

            InitializeDatabaseInterfaces();
        }
コード例 #14
0
        public static void Serialize <T>(KSoft.IO.XmlElementStream s, FA mode, BXmlSerializerInterface xsi,
                                         Collections.BListAutoId <T> list, BListXmlParams @params, bool forceNoRootElementStreaming = false)
            where T : class, Collections.IListAutoIdObject, new()
        {
            Contract.Requires(s != null);
            Contract.Requires(xsi != null);
            Contract.Requires(list != null);
            Contract.Requires(@params != null);

            if (forceNoRootElementStreaming)
            {
                @params.SetForceNoRootElementStreaming(true);
            }
            using (var xs = CreateXmlSerializer(list, @params))
            {
                xs.StreamXml(s, mode, xsi);
            }
            if (forceNoRootElementStreaming)
            {
                @params.SetForceNoRootElementStreaming(false);
            }
        }
コード例 #15
0
 public BUserClass()
 {
     Fields = new Collections.BListAutoId <BUserClassField>();
 }
コード例 #16
0
        internal static int TryGetIdWithUndefined <T>(Dictionary <string, T> dbi, string name, Collections.BListAutoId <T> list)
            where T : class, Collections.IListAutoIdObject, new()
        {
            int id = TryGetId(dbi, name, null);

            if (id == Util.kInvalidInt32)
            {
                id = list.UndefinedInterface.GetMemberIdOrUndefined(name);
            }

            return(id);
        }
コード例 #17
0
 internal static string TryGetNameWithUndefined <T>(Collections.BListAutoId <T> dbi, int id)
     where T : class, Collections.IListAutoIdObject, new()
 {
     return(dbi.UndefinedInterface.GetMemberNameOrUndefined(id));
 }
コード例 #18
0
 static int TryGetIdWithUndefined <T>(Collections.BListAutoId <T> dbi, string name)
     where T : class, Collections.IListAutoIdObject, new()
 {
     return(dbi.UndefinedInterface.GetMemberIdOrUndefined(name));
 }
コード例 #19
0
 static int TryGetId <T>(Collections.BListAutoId <T> dbi, string name)
     where T : class, Collections.IListAutoIdObject, new()
 {
     return(dbi.TryGetMemberId(name));
 }
コード例 #20
0
 public BUserClass()
 {
     mDbId  = Util.kInvalidInt32;
     Fields = new Collections.BListAutoId <BUserClassField>();
 }
コード例 #21
0
 protected override void FinishTlsStreaming()
 {
     mParams = null;
     mList   = null;
 }
コード例 #22
0
 public BTrigger()
 {
     Conditions     = new Collections.BListAutoId <BTriggerCondition>();
     EffectsOnTrue  = new Collections.BListAutoId <BTriggerEffect>();
     EffectsOnFalse = new Collections.BListAutoId <BTriggerEffect>();
 }
コード例 #23
0
        // bool RocketAllGrunts, MinimapHidden
        // int BonusSquadLevels, DeathExplodeObjectType, DeathExplodeProtoObject
        // float DeathExplodeChance

        public BCollectiblesSkullManager()
        {
            Skulls = new Collections.BListAutoId <BCollectibleSkull>();
        }