Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        stats     = new StatForHum();
        _health   = stats.GetStat(StatType.Health);
        _armor    = stats.GetStat(StatType.Armor);
        _strength = stats.GetStat(StatType.Strength);
        var statTypes = Enum.GetValues(typeof(StatType));

        foreach (var statType in statTypes)
        {
            Stat stat = stats.GetStat((StatType)statType);
            if (stat != null)
            {
                if (stat.StatName == "Health")
                {
                    HealthText.text = stat.StatValue.ToString();
                }
                else
                {
                    if (stat.StatName == "Armor")
                    {
                        ArmorText.text = stat.StatValue.ToString();
                    }
                    else
                    {
                        StrengthText.text = stat.StatValue.ToString();
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     stats     = new StatsForItem();
     _health   = stats.GetStat(StatType.Health);
     _armor    = stats.GetStat(StatType.Armor);
     _strength = stats.GetStat(StatType.Strength);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Get the updated stats
        /// </summary>
        /// <returns></returns>
        public StatsCollection GetStats()
        {
            _stats = new StatsCollection();

            _stats.PC.NotPlayedAmount = _database.GetAmountWithPlatformStatus(nameof(_stats.PC), Status.NotPlayed.ToString());
            _stats.PC.PlayedAmount    = _database.GetAmountWithPlatformStatus(nameof(_stats.PC), Status.Played.ToString());
            _stats.PC.CompleteAmount  = _database.GetAmountWithPlatformStatus(nameof(_stats.PC), Status.Complete.ToString());
            _stats.PC.AbandonedAmount = _database.GetAmountWithPlatformStatus(nameof(_stats.PC), Status.Abandoned.ToString());

            _stats.PS4.NotPlayedAmount = _database.GetAmountWithPlatformStatus(nameof(_stats.PS4), Status.NotPlayed.ToString());
            _stats.PS4.PlayedAmount    = _database.GetAmountWithPlatformStatus(nameof(_stats.PS4), Status.Played.ToString());
            _stats.PS4.CompleteAmount  = _database.GetAmountWithPlatformStatus(nameof(_stats.PS4), Status.Complete.ToString());
            _stats.PS4.AbandonedAmount = _database.GetAmountWithPlatformStatus(nameof(_stats.PS4), Status.Abandoned.ToString());

            _stats.PS3.NotPlayedAmount = _database.GetAmountWithPlatformStatus(nameof(_stats.PS3), Status.NotPlayed.ToString());
            _stats.PS3.PlayedAmount    = _database.GetAmountWithPlatformStatus(nameof(_stats.PS3), Status.Played.ToString());
            _stats.PS3.CompleteAmount  = _database.GetAmountWithPlatformStatus(nameof(_stats.PS3), Status.Complete.ToString());
            _stats.PS3.AbandonedAmount = _database.GetAmountWithPlatformStatus(nameof(_stats.PS3), Status.Abandoned.ToString());

            _stats.PSVita.NotPlayedAmount = _database.GetAmountWithPlatformStatus(nameof(_stats.PSVita), Status.NotPlayed.ToString());
            _stats.PSVita.PlayedAmount    = _database.GetAmountWithPlatformStatus(nameof(_stats.PSVita), Status.Played.ToString());
            _stats.PSVita.CompleteAmount  = _database.GetAmountWithPlatformStatus(nameof(_stats.PSVita), Status.Complete.ToString());
            _stats.PSVita.AbandonedAmount = _database.GetAmountWithPlatformStatus(nameof(_stats.PSVita), Status.Abandoned.ToString());

            return(_stats);
        }
Exemplo n.º 4
0
 public StatsListener(StatsCollection collection)
 {
     Guard.NotNull(collection);
     this.collection = collection;
     collection.AddListener(this);
     collection.Counters.Each(kv => lastCounters[kv.Key] = kv.Value);
 }
 public void Setup()
 {
     stats = new StatsCollection();
     listener = new StatsListener(stats);
     collector = new TimeSeriesCollector(listener, false);
     timeFreeze = SystemClock.Freeze();
 }
Exemplo n.º 6
0
 public TimeSeriesCollectorTests()
 {
     stats      = new StatsCollection();
     listener   = new StatsListener(stats);
     collector  = new TimeSeriesCollector(listener, false);
     timeFreeze = SystemClock.Freeze();
 }
Exemplo n.º 7
0
    public void UpdatePlayerStats(StatsCollection stats, StatsCollection best)
    {
        PlayerStatisticsView serverLocalPlayerStatisticsView = ServerLocalPlayerStatisticsView;
        int xp         = serverLocalPlayerStatisticsView.Xp + GameState.Current.Statistics.GainedXp;
        int levelForXp = XpPointsUtil.GetLevelForXp(xp);

        SetPlayerStatisticsView(new PlayerStatisticsView(serverLocalPlayerStatisticsView.Cmid,
                                                         serverLocalPlayerStatisticsView.Splats + stats.GetKills(),
                                                         serverLocalPlayerStatisticsView.Splatted + stats.Deaths,
                                                         serverLocalPlayerStatisticsView.Shots + stats.GetShots(),
                                                         serverLocalPlayerStatisticsView.Hits + stats.GetHits(),
                                                         serverLocalPlayerStatisticsView.Headshots + stats.Headshots,
                                                         serverLocalPlayerStatisticsView.Nutshots + stats.Nutshots,
                                                         xp,
                                                         levelForXp,
                                                         new PlayerPersonalRecordStatisticsView((
                                                                                                    serverLocalPlayerStatisticsView.PersonalRecord.MostHeadshots <= best.Headshots) ? best.Headshots : serverLocalPlayerStatisticsView.PersonalRecord.MostHeadshots,
                                                                                                (serverLocalPlayerStatisticsView.PersonalRecord.MostNutshots <= best.Nutshots) ? best.Nutshots : serverLocalPlayerStatisticsView.PersonalRecord.MostNutshots,
                                                                                                (serverLocalPlayerStatisticsView.PersonalRecord.MostConsecutiveSnipes <= best.ConsecutiveSnipes) ? best.ConsecutiveSnipes : serverLocalPlayerStatisticsView.PersonalRecord.MostConsecutiveSnipes, 0,
                                                                                                (serverLocalPlayerStatisticsView.PersonalRecord.MostSplats <= best.GetKills()) ? best.GetKills() : serverLocalPlayerStatisticsView.PersonalRecord.MostSplats,
                                                                                                (serverLocalPlayerStatisticsView.PersonalRecord.MostDamageDealt <= best.GetDamageDealt()) ? best.GetDamageDealt() : serverLocalPlayerStatisticsView.PersonalRecord.MostDamageDealt,
                                                                                                (serverLocalPlayerStatisticsView.PersonalRecord.MostDamageReceived <= best.DamageReceived) ? best.DamageReceived : serverLocalPlayerStatisticsView.PersonalRecord.MostDamageReceived,
                                                                                                (serverLocalPlayerStatisticsView.PersonalRecord.MostArmorPickedUp <= best.ArmorPickedUp) ? best.ArmorPickedUp : serverLocalPlayerStatisticsView.PersonalRecord.MostArmorPickedUp,
                                                                                                (serverLocalPlayerStatisticsView.PersonalRecord.MostHealthPickedUp <= best.HealthPickedUp) ? best.HealthPickedUp : serverLocalPlayerStatisticsView.PersonalRecord.MostHealthPickedUp,
                                                                                                (serverLocalPlayerStatisticsView.PersonalRecord.MostMeleeSplats <= best.MeleeKills) ? best.MeleeKills : serverLocalPlayerStatisticsView.PersonalRecord.MostMeleeSplats,
                                                                                                (serverLocalPlayerStatisticsView.PersonalRecord.MostMachinegunSplats <= best.MachineGunKills) ? best.MachineGunKills : serverLocalPlayerStatisticsView.PersonalRecord.MostMachinegunSplats,
                                                                                                (serverLocalPlayerStatisticsView.PersonalRecord.MostShotgunSplats <= best.ShotgunSplats) ? best.ShotgunSplats : serverLocalPlayerStatisticsView.PersonalRecord.MostShotgunSplats,
                                                                                                (serverLocalPlayerStatisticsView.PersonalRecord.MostSniperSplats <= best.SniperKills) ? best.SniperKills : serverLocalPlayerStatisticsView.PersonalRecord.MostSniperSplats,
                                                                                                (serverLocalPlayerStatisticsView.PersonalRecord.MostSplattergunSplats <= best.SplattergunKills) ? best.SplattergunKills : serverLocalPlayerStatisticsView.PersonalRecord.MostSplattergunSplats,
                                                                                                (serverLocalPlayerStatisticsView.PersonalRecord.MostCannonSplats <= best.CannonKills) ? best.CannonKills : serverLocalPlayerStatisticsView.PersonalRecord.MostCannonSplats,
                                                                                                (serverLocalPlayerStatisticsView.PersonalRecord.MostLauncherSplats <= best.LauncherKills) ? best.LauncherKills : serverLocalPlayerStatisticsView.PersonalRecord.MostLauncherSplats),
                                                         new PlayerWeaponStatisticsView(serverLocalPlayerStatisticsView.WeaponStatistics.MeleeTotalSplats + stats.MeleeKills,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.MachineGunTotalSplats + stats.MachineGunKills,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.ShotgunTotalSplats + stats.ShotgunSplats,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.SniperTotalSplats + stats.SniperKills,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.SplattergunTotalSplats + stats.SplattergunKills,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.CannonTotalSplats + stats.CannonKills,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.LauncherTotalSplats + stats.LauncherKills,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.MeleeTotalShotsFired + stats.MeleeShotsFired,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.MeleeTotalShotsHit + stats.MeleeShotsHit,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.MeleeTotalDamageDone + stats.MeleeDamageDone,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.MachineGunTotalShotsFired + stats.MachineGunShotsFired,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.MachineGunTotalShotsHit + stats.MachineGunShotsHit,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.MachineGunTotalDamageDone + stats.MachineGunDamageDone,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.ShotgunTotalShotsFired + stats.ShotgunShotsFired,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.ShotgunTotalShotsHit + stats.ShotgunShotsHit,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.ShotgunTotalDamageDone + stats.ShotgunDamageDone,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.SniperTotalShotsFired + stats.SniperShotsFired,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.SniperTotalShotsHit + stats.SniperShotsHit,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.SniperTotalDamageDone + stats.SniperDamageDone,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.SplattergunTotalShotsFired + stats.SplattergunShotsFired,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.SplattergunTotalShotsHit + stats.SplattergunShotsHit,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.SplattergunTotalDamageDone + stats.SplattergunDamageDone,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.CannonTotalShotsFired + stats.CannonShotsFired,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.CannonTotalShotsHit + stats.CannonShotsHit,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.CannonTotalDamageDone + stats.CannonDamageDone,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.LauncherTotalShotsFired + stats.LauncherShotsFired,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.LauncherTotalShotsHit + stats.LauncherShotsHit,
                                                                                        serverLocalPlayerStatisticsView.WeaponStatistics.LauncherTotalDamageDone + stats.LauncherDamageDone)));
    }
Exemplo n.º 8
0
        public void ConfirmRecipe()
        {
            Assert.AreEqual(new Stat("Trouble"), new Stat("Trouble"));

            // Create a new collection where all stats are 0
            var collection = new StatsCollection(0);

            Assert.AreEqual(0, collection[new Stat("Dangerous")]);

            // Invent a new stat and set it to 10
            collection[new Stat("Wild")] = 10;
            Assert.AreEqual(10, collection[new Stat("Wild")]);



            var world = Setup("stats.yaml", statsYaml, "rooms.yaml", roomYaml);

            // naturally you cannot seduce
            Assert.AreEqual(0, world.Player.BaseStats[world.AllStats.Get("Seduction")]);

            // but in the bar you are more seductive
            Assert.AreEqual(10, world.Player.GetFinalStats()[world.AllStats.Get("Seduction")]);

            //player would be able to equip the helmet of madness if he wanted to
            Assert.IsTrue(world.Player.CurrentLocation.Items[0].RequirementsMet(world.Player));

            // now you are too hot to wear the madness hat
            world.Player.BaseStats[new Stat("Seduction")] = 60;
            Assert.IsFalse(world.Player.CurrentLocation.Items[0].RequirementsMet(world.Player));
        }
        public void AddedStatCanBeFound()
        {
            // Assign
            var statsCollection = new StatsCollection(new List <IStatsProvider>()
            {
                new FakeStatsProvider()
            });

            // Act
            statsCollection.Prepare();
            statsCollection.Add("Default", new Stat(new FakeStatDefinition()
            {
                category = "Default", statName = "Agility"
            }));
            statsCollection.Add("Default2", new Stat(new FakeStatDefinition()
            {
                category = "Default", statName = "Agility"
            }));

            // Assert
            Assert.IsNotNull(statsCollection.Get("Default", "Agility"));
            Assert.IsNotNull(statsCollection.GetCategory("Default"));
            Assert.IsNotNull(statsCollection.GetCategory("Default2"));
            Assert.IsNotNull(statsCollection.Get("Default2", "Agility"));
        }
Exemplo n.º 10
0
        //Serialized
        public PokemonEntity(int id, bool shiny = false, int extraivs = 0, bool maxivs = false)
        {
            Random x = new Random(Environment.TickCount.GetHashCode());

            ID = id;
            var model = GetModel();

            OwnerID           = 0;
            Nickname          = model.Name;
            Shiny             = (shiny) ? true : (x.Next(300 + 1) == 1);
            Nature            = (NatureType)(x.Next((int)NatureType.END));
            CurrentExperience = 0;
            Level             = x.Next(1, 35 + 1);
            IVs = new StatsCollection
                  (
                maxivs ? 31 : x.Next(31 + 1) + extraivs,
                maxivs ? 31 : x.Next(31 + 1) + extraivs,
                maxivs ? 31 : x.Next(31 + 1) + extraivs,
                maxivs ? 31 : x.Next(31 + 1) + extraivs,
                maxivs ? 31 : x.Next(31 + 1) + extraivs,
                maxivs ? 31 : x.Next(31 + 1) + extraivs
                  );
            EVs         = new StatsCollection();
            Moves       = new List <int>();
            RemainingPS = Stats[StatTypeEnum.HP];
        }
Exemplo n.º 11
0
        public void TestStats_Increase()
        {
            var s1 = new StatsCollection();

            Assert.AreEqual(0, s1[Stat.Fight]);
            s1.Increase(Stat.Fight, 10);
            Assert.AreEqual(10, s1[Stat.Fight]);
        }
Exemplo n.º 12
0
        public void TestStats_IncreaseByStartingValue()
        {
            var sc1 = new StatsCollection(10);
            var sc2 = new StatsCollection(12);

            sc1.Increase(sc2);

            Assert.AreEqual(22, sc1[Stat.Fight]);
        }
Exemplo n.º 13
0
        public void TestStats_DecreaseAll()
        {
            var s1 = new StatsCollection();

            Assert.AreEqual(0, s1[Stat.Fight]);
            s1.Decrease(new StatsCollection(10));
            Assert.AreEqual(-10, s1[Stat.Fight]);
            Assert.IsTrue(s1.All(v => v.Value == -10));
        }
Exemplo n.º 14
0
        public void TestStats_IsEmpty()
        {
            var s1 = new StatsCollection();

            Assert.IsTrue(s1.IsEmpty());
            s1[Stat.Fight] = 0.0000000000001;
            Assert.IsTrue(s1.IsEmpty());
            s1[Stat.Fight] = 1;
            Assert.IsFalse(s1.IsEmpty());
        }
Exemplo n.º 15
0
        public void TestStats_SetAll()
        {
            var s1 = new StatsCollection(5);

            Assert.AreEqual(5, s1[Stat.Fight]);
            Assert.AreEqual(5, s1["Savvy"]);

            s1.SetAll((s, v) => v * (s == Stat.Fight ? 2 : 1));
            Assert.AreEqual(10, s1[Stat.Fight]);
            Assert.AreEqual(5, s1["Savvy"]);
        }
        public void RemoveNonExistingStat()
        {
            // Assign
            var statsCollection = new StatsCollection(new List <IStatsProvider>()
            {
                new FakeStatsProvider()
            });

            // Act
            statsCollection.Prepare();
            bool removed = statsCollection.Remove("Default", "NonExistent");

            // Assert
            Assert.IsFalse(removed);
        }
        public void FindingStatThatDoesntExistShouldReturnNull()
        {
            // Assign
            var statsCollection = new StatsCollection(new List <IStatsProvider>()
            {
                new FakeStatsProvider()
            });

            // Act
            statsCollection.Prepare();

            // Assert
            Assert.IsNull(statsCollection.Get("NonExistent", "Nope"));
            Assert.IsNull(statsCollection.GetCategory("NonExistent"));
        }
Exemplo n.º 18
0
        public void Lee_speed_of_alogithm()
        {
            var logins = PasscodeDerivation.KeyLog.Lines();

            StatsCollection result = LinqPadUX.Measure.Action(() => LeeSolution.Compute(logins));

            var builder = new StringBuilder();

            result.WriteReportTable(new StringWriter(builder), 1f);

            var temporaryFile = FileUtility.GetTemporaryFile(".html");

            File.WriteAllText(temporaryFile, builder.ToString());
            System.Diagnostics.Process.Start(temporaryFile);
            //File.Delete(temporaryFile);
        }
Exemplo n.º 19
0
        public void TestStats_AreIdentical()
        {
            var s1 = new StatsCollection();
            var s2 = new StatsCollection();

            Assert.IsFalse(s1.AreIdentical(null));

            Assert.IsTrue(s1.AreIdentical(s1));
            Assert.IsTrue(s1.AreIdentical(s2));

            s2[Stat.Fight] = 10;
            Assert.IsFalse(s1.AreIdentical(s2));

            s1[Stat.Fight] = 10;
            Assert.IsTrue(s1.AreIdentical(s2));
        }
        public void RemoveStat()
        {
            // Assign
            var statsCollection = new StatsCollection(new List <IStatsProvider>()
            {
                new FakeStatsProvider()
            });

            // Act
            statsCollection.Prepare();
            bool removed = statsCollection.Remove("Default", "Health");

            // Assert
            Assert.IsNull(statsCollection.Get("Default", "Health"));
            Assert.IsTrue(removed);
        }
        public void InitializingStatsCollectionShouldUseDataProviderToFill()
        {
            // Assign
            var statsCollection = new StatsCollection(new List <IStatsProvider>()
            {
                new FakeStatsProvider()
            });

            // Act
            statsCollection.Prepare();

            // Assert
            Assert.IsTrue(statsCollection.ContainsCategory("Default"));
            Assert.IsTrue(statsCollection.ContainsStat("Default", "Health"));
            Assert.IsNotNull(statsCollection.Get("Default", "Health"));
            Assert.IsNotNull(statsCollection.GetCategory("Default"));
        }
 // Token: 0x060010CD RID: 4301 RVA: 0x00017534 File Offset: 0x00015734
 public static void Serialize(Stream stream, StatsCollection instance)
 {
     using (MemoryStream memoryStream = new MemoryStream())
     {
         Int32Proxy.Serialize(memoryStream, instance.ArmorPickedUp);
         Int32Proxy.Serialize(memoryStream, instance.CannonDamageDone);
         Int32Proxy.Serialize(memoryStream, instance.CannonKills);
         Int32Proxy.Serialize(memoryStream, instance.CannonShotsFired);
         Int32Proxy.Serialize(memoryStream, instance.CannonShotsHit);
         Int32Proxy.Serialize(memoryStream, instance.ConsecutiveSnipes);
         Int32Proxy.Serialize(memoryStream, instance.DamageReceived);
         Int32Proxy.Serialize(memoryStream, instance.Deaths);
         Int32Proxy.Serialize(memoryStream, instance.Headshots);
         Int32Proxy.Serialize(memoryStream, instance.HealthPickedUp);
         Int32Proxy.Serialize(memoryStream, instance.LauncherDamageDone);
         Int32Proxy.Serialize(memoryStream, instance.LauncherKills);
         Int32Proxy.Serialize(memoryStream, instance.LauncherShotsFired);
         Int32Proxy.Serialize(memoryStream, instance.LauncherShotsHit);
         Int32Proxy.Serialize(memoryStream, instance.MachineGunDamageDone);
         Int32Proxy.Serialize(memoryStream, instance.MachineGunKills);
         Int32Proxy.Serialize(memoryStream, instance.MachineGunShotsFired);
         Int32Proxy.Serialize(memoryStream, instance.MachineGunShotsHit);
         Int32Proxy.Serialize(memoryStream, instance.MeleeDamageDone);
         Int32Proxy.Serialize(memoryStream, instance.MeleeKills);
         Int32Proxy.Serialize(memoryStream, instance.MeleeShotsFired);
         Int32Proxy.Serialize(memoryStream, instance.MeleeShotsHit);
         Int32Proxy.Serialize(memoryStream, instance.Nutshots);
         Int32Proxy.Serialize(memoryStream, instance.Points);
         Int32Proxy.Serialize(memoryStream, instance.ShotgunDamageDone);
         Int32Proxy.Serialize(memoryStream, instance.ShotgunShotsFired);
         Int32Proxy.Serialize(memoryStream, instance.ShotgunShotsHit);
         Int32Proxy.Serialize(memoryStream, instance.ShotgunSplats);
         Int32Proxy.Serialize(memoryStream, instance.SniperDamageDone);
         Int32Proxy.Serialize(memoryStream, instance.SniperKills);
         Int32Proxy.Serialize(memoryStream, instance.SniperShotsFired);
         Int32Proxy.Serialize(memoryStream, instance.SniperShotsHit);
         Int32Proxy.Serialize(memoryStream, instance.SplattergunDamageDone);
         Int32Proxy.Serialize(memoryStream, instance.SplattergunKills);
         Int32Proxy.Serialize(memoryStream, instance.SplattergunShotsFired);
         Int32Proxy.Serialize(memoryStream, instance.SplattergunShotsHit);
         Int32Proxy.Serialize(memoryStream, instance.Suicides);
         Int32Proxy.Serialize(memoryStream, instance.Xp);
         memoryStream.WriteTo(stream);
     }
 }
Exemplo n.º 23
0
 public PokemonModel(Pokemon pokemon, List <int> idmoves)
 {
     ID               = pokemon.ID;
     Name             = pokemon.Name;
     BaseExperience   = pokemon.BaseExperience;
     AvailableMoveIDS = idmoves;
     BackMale         = pokemon.Sprites.BackMale;
     BackFemale       = pokemon.Sprites.BackFemale;
     BackMaleShiny    = pokemon.Sprites.BackShinyMale;
     BackFemaleShiny  = pokemon.Sprites.BackFemale;
     FrontMale        = pokemon.Sprites.FrontMale;
     FrontFemale      = pokemon.Sprites.FrontFemale;
     FrontMaleShiny   = pokemon.Sprites.FrontShinyMale;
     FrontFemaleShiny = pokemon.Sprites.FrontShinyFemale;
     Types            = pokemon.Types.Select(x => PokemonData._pokemontypes[x.Type.Name]).ToList();
     BaseStats        = new StatsCollection();
     EffortStats      = new StatsCollection();
 }
Exemplo n.º 24
0
        /// <summary>
        /// Gets the stats.
        /// </summary>
        /// <returns></returns>
        public StatsCollection GetStats()
        {
            var result = new StatsCollection();

            if (this.options.StatsFields == null || this.options.StatsFields.Count == 0)
            {
                return(result);
            }

            var profileDetails = this.trackerApi.GetProfileDetails(this.options.Platform, this.options.EpicUserName);

            if (profileDetails != null)
            {
                result.Add(profileDetails.AllStats?.GlobalSolo?.Kills?.Label, profileDetails.AllStats?.GlobalSolo?.Kills?.DisplayValue);
                result.Add(profileDetails.AllStats?.GlobalSolo?.WinRate?.Label, profileDetails.AllStats?.GlobalSolo?.WinRate?.DisplayValue);
            }

            return(result);
        }
Exemplo n.º 25
0
    // Token: 0x06001A91 RID: 6801 RVA: 0x0008AB2C File Offset: 0x00088D2C
    public void UpdatePlayerStatistics(StatsCollection totalStats, StatsCollection bestPerLife)
    {
        int playerLevel = PlayerDataManager.PlayerLevel;

        if (playerLevel > 0 && playerLevel < XpPointsUtil.Config.MaxLevel)
        {
            Singleton <PlayerDataManager> .Instance.UpdatePlayerStats(totalStats, bestPerLife);

            if (PlayerDataManager.PlayerLevel != playerLevel)
            {
                PopupSystem.Show(new LevelUpPopup(PlayerDataManager.PlayerLevel, playerLevel, null));
            }
            GlobalUIRibbon.Instance.AddXPEvent(totalStats.Xp);
        }
        if (totalStats.Points > 0)
        {
            PlayerDataManager.Points += totalStats.Points;
            GlobalUIRibbon.Instance.AddPointsEvent(totalStats.Points);
        }
    }
Exemplo n.º 26
0
		public void Start() {
			if(worker != null) 
				throw new InvalidOperationException("Agent already started.");
			BeginCollection();
			worker = new Thread(() => {
				try {
					Task nextSample;
					for (var lastFlush = AlignToInterval(DateTime.UtcNow, FlushInterval); ; nextSample.Wait()) {
						nextSample = Task.Delay(SampleInterval);
						Read();
						if (DateTime.UtcNow - lastFlush < FlushInterval)
							continue;

						lastFlush += FlushInterval;
						Flush(lastFlush);
					}
				} catch(Exception ex) {
					collectedStats = null;
					HandleError(ex);
				}
				worker = null;
			});
			worker.Start();
		}
Exemplo n.º 27
0
 public void Given_empty_stats()
 {
     Stats = new StatsCollection();
 }
Exemplo n.º 28
0
 // Token: 0x06001C5D RID: 7261 RVA: 0x00012D1F File Offset: 0x00010F1F
 public float GetKdr(StatsCollection stats)
 {
     return((float)Mathf.Max(stats.GetKills(), 0) / Mathf.Max((float)stats.Deaths, 1f));
 }
Exemplo n.º 29
0
 public StatsCollection Modify(StatsCollection stats)
 {
     return(stats.Clone().Multiply(StatsRatio, true));
 }
Exemplo n.º 30
0
 public StatsViewModel(IStatsModel model)
 {
     _model = model;
     _stats = _model.GetStats();
 }
Exemplo n.º 31
0
 public Player()
 {
     StatBuffs = new StatsCollection(true);
 }
Exemplo n.º 32
0
 public StatsCollectionSpec()
 {
     Stats = new StatsCollection();
 }
Exemplo n.º 33
0
 public void Setup()
 {
     stats = new StatsCollection();
 }
Exemplo n.º 34
0
 public StatsCollectionTests()
 {
     stats = new StatsCollection();
 }
Exemplo n.º 35
0
		public void BeginCollection() {
			if(collectedStats == null)
			collectedStats = new StatsCollection(config);
		}
Exemplo n.º 36
0
 public void Setup()
 {
     stats = new StatsCollection();
 }