public BTriggerSystem()
        {
            Groups = new Collections.BListAutoId <BTriggerGroup>();

            Vars     = new Collections.BListAutoId <BTriggerVar>();
            Triggers = new Collections.BListAutoId <BTrigger>();
        }
Example #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);
 }
Example #3
0
		public BListAutoIdXmlSerializer(BListXmlParams @params, Collections.BListAutoId<T> list)
		{
			Contract.Requires<ArgumentNullException>(@params != null);
			Contract.Requires<ArgumentNullException>(list != null);

			mParams = @params;
			mList = list;
		}
        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);
        }
Example #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;
		}
        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);
            }
        }
Example #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();
        }
        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();
        }
        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);
        }
        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);
        }
Example #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);
		}
Example #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();
		}
        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();
        }
        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);
            }
        }
 public BUserClass()
 {
     Fields = new Collections.BListAutoId <BUserClassField>();
 }
        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);
        }
 internal static string TryGetNameWithUndefined <T>(Collections.BListAutoId <T> dbi, int id)
     where T : class, Collections.IListAutoIdObject, new()
 {
     return(dbi.UndefinedInterface.GetMemberNameOrUndefined(id));
 }
 static int TryGetIdWithUndefined <T>(Collections.BListAutoId <T> dbi, string name)
     where T : class, Collections.IListAutoIdObject, new()
 {
     return(dbi.UndefinedInterface.GetMemberIdOrUndefined(name));
 }
 static int TryGetId <T>(Collections.BListAutoId <T> dbi, string name)
     where T : class, Collections.IListAutoIdObject, new()
 {
     return(dbi.TryGetMemberId(name));
 }
Example #20
0
 public BUserClass()
 {
     mDbId  = Util.kInvalidInt32;
     Fields = new Collections.BListAutoId <BUserClassField>();
 }
 protected override void FinishTlsStreaming()
 {
     mParams = null;
     mList   = null;
 }
Example #22
0
 public BTrigger()
 {
     Conditions     = new Collections.BListAutoId <BTriggerCondition>();
     EffectsOnTrue  = new Collections.BListAutoId <BTriggerEffect>();
     EffectsOnFalse = new Collections.BListAutoId <BTriggerEffect>();
 }
Example #23
0
        // bool RocketAllGrunts, MinimapHidden
        // int BonusSquadLevels, DeathExplodeObjectType, DeathExplodeProtoObject
        // float DeathExplodeChance

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