Beispiel #1
0
        /* G E N  G A M E  S T A T S */
        /*----------------------------------------------------------------------------
                %%Function: GameData
                %%Qualified: GenCount.CountsData:GameData.GameData
                %%Contact: rlittle

            ----------------------------------------------------------------------------*/
        public GameData(StatusRpt srpt)
        {
            //  m_sRoster = null;
            m_srpt = srpt;
            m_rst = new Roster(srpt);
            m_gms = new GameSlots(srpt);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="Player"/> class.
        /// </summary>
        /// <param name="Device">The device.</param>
        /// <param name="HighID">The high identifier.</param>
        /// <param name="LowID">The low identifier.</param>
        internal Player(Device Device, int HighID, int LowID) : this()
        {
            this.Device = Device;
            this.HighID = HighID;
            this.LowID  = LowID;

            this.Objects    = new Objects(this);
            this.Facebook   = new Facebook(this);
            this.Google     = new Google(this);
            this.Gamecenter = new Gamecenter(this);

            this.Resources    = new Resources(this, true);
            this.ResourceCaps = new Caps(this);

            this.Variables = new Variables(this, true);

            this.Units         = new GameSlots();
            this.Units2        = new GameSlots();
            this.Spells        = new GameSlots();
            this.AllianceUnits = new GameSlots();

            this.HeroStates  = new GameSlots();
            this.HeroHealth  = new GameSlots();
            this.HeroUpgrade = new GameSlots();

            this.NpcProgress     = new GameSlots();
            this.NpcLootedGold   = new GameSlots();
            this.NpcLootedElixir = new GameSlots();

            this.UnitPreset1 = new GameSlots();
            this.UnitPreset2 = new GameSlots();
            this.UnitPreset3 = new GameSlots();

            this.PreviousArmy = new GameSlots();

            this.Missions = new Missions(this);

            this.UnitUpgrades  = new Upgrades(this);
            this.SpellUpgrades = new Upgrades(this);

            this.Achievements = new Achievements(this);
            this.Progress     = new Progress(this);

#if DEBUG
            this.Missions.Add(21000017);
            this.Missions.Add(21000018);
            this.Missions.Add(21000019);
            this.Missions.Add(21000020);
            this.Missions.Add(21000021);
            this.Missions.Add(21000022);
            this.Missions.Add(21000023);
            this.Missions.Add(21000024);
            this.Missions.Add(21000025);
#endif
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="Player"/> class.
        /// </summary>
        internal Player()
        {
            this.Objects    = new Objects(this);
            this.Facebook   = new Facebook(this);
            this.Google     = new Google(this);
            this.Gamecenter = new Gamecenter(this);

            this.Resources    = new Resources(this);
            this.ResourceCaps = new Caps(this);

            this.Variables = new Variables(this);

            this.Units  = new GameSlots();
            this.Units2 = new GameSlots();

            this.Spells        = new GameSlots();
            this.AllianceUnits = new GameSlots();

            this.HeroStates  = new GameSlots();
            this.HeroHealth  = new GameSlots();
            this.HeroUpgrade = new GameSlots();

            this.NpcProgress     = new GameSlots();
            this.NpcLootedGold   = new GameSlots();
            this.NpcLootedElixir = new GameSlots();

            this.UnitPreset1 = new GameSlots();
            this.UnitPreset2 = new GameSlots();
            this.UnitPreset3 = new GameSlots();

            this.PreviousArmy = new GameSlots();

            this.Missions = new Missions(this);

            this.UnitUpgrades  = new Upgrades(this);
            this.SpellUpgrades = new Upgrades(this);

            this.Achievements = new Achievements(this);
            this.Progress     = new Progress(this);
        }
Beispiel #4
0
            /* G A M E S  F R O M  F I L T E R */
            /*----------------------------------------------------------------------------
                %%Function: GamesFromFilter
                %%Qualified: ArbWeb.GameData.Games.GamesFromFilter
                %%Contact: rlittle

            ----------------------------------------------------------------------------*/
            public GameSlots GamesFromFilter(string[] rgsSportFilter, string[] rgsSportLevelFilter, bool fOpenOnly, SlotAggr sa)
            {
                GameSlots gms = new GameSlots(m_srpt);

                DateTime dttmStart = sa.DttmStart;
                DateTime dttmEnd = sa.DttmEnd;

                SortedList<string, int> plsSports = Utils.PlsUniqueFromRgs(rgsSportFilter);
                SortedList<string, int> plsLevels = Utils.PlsUniqueFromRgs(rgsSportLevelFilter);

                foreach (GameSlot gm in m_plgmsSorted.Values)
                    {
                    if (!gm.Open && fOpenOnly)
                        continue;

                    if (DateTime.Compare(gm.Dttm, dttmStart) < 0 || DateTime.Compare(gm.Dttm, dttmEnd) > 0)
                        continue;

                    if (plsSports != null && !(plsSports.ContainsKey(gm.Sport)))
                        continue;

                    if (plsLevels != null && !(plsLevels.ContainsKey(gm.SportLevel)))
                        continue;

                    gms.AddGame(gm);
                    }
                return gms;
            }