コード例 #1
0
ファイル: ProceduralSpellProj.cs プロジェクト: TNTftw21/kRPG
 public override void Kill(int timeLeft)
 {
     foreach (Action <ProceduralSpellProj> action in Kills.Where(action => action != null))
     {
         action(this);
     }
     if (timeLeft > 0)
     {
         //Main.PlaySound(SoundID.Dig, projectile.position);
         SoundManager.PlaySound(Sounds.Dig, projectile.position);
     }
 }
コード例 #2
0
        private void OnKillsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            KillCount       = Kills.Count;
            JumpKillCount   = Kills.Count(killEvent => killEvent.KillerVelocityZ > 0);
            CrouchKillCount = Kills.Count(killEvent => killEvent.IsKillerCrouching);
            TradeKillCount  = Kills.Count(k => k.IsTradeKill);

            var kills = Kills.Where(k => k.KillerSide != k.KilledSide && k.KillerSteamId != 0)
                        .GroupBy(k => k.KillerSteamId)
                        .Select(group => new
            {
                SteamId   = group.Key,
                KillCount = group.Count()
            }).ToList();

            OneKillCount   = kills.Count(k => k.KillCount == 1);
            TwoKillCount   = kills.Count(k => k.KillCount == 2);
            ThreeKillCount = kills.Count(k => k.KillCount == 3);
            FourKillCount  = kills.Count(k => k.KillCount == 4);
            FiveKillCount  = kills.Count(k => k.KillCount == 5);
        }