コード例 #1
0
        private static void Game_OnTick(EventArgs args)
        {
            DetectedEmpoweredAttacks.RemoveAll(a => a.Ended);

            foreach (var attack in DetectedEmpoweredAttacks)
            {
                OnEmpoweredAttackDetected.Invoke(attack);
            }
        }
コード例 #2
0
        private static void Add(DetectedEmpoweredAttackData data)
        {
            if (data == null || DetectedEmpoweredAttacks.Contains(data))
            {
                Console.WriteLine("Invalid DetectedEmpoweredAttackData");
                return;
            }

            OnEmpoweredAttackDetected.Invoke(data);
            DetectedEmpoweredAttacks.Add(data);
        }
コード例 #3
0
        private static void Add(DetectedEmpoweredAttackData data)
        {
            if (data == null || DetectedEmpoweredAttacks.Contains(data))
            {
                Console.WriteLine("Invalid DetectedEmpoweredAttackData");
                return;
            }

            if (data.Missile != null)
            {
                var detect = DetectedEmpoweredAttacks.FirstOrDefault(a => a.Caster.IdEquals(data.Caster) && a.Missile == null && a.Data.Equals(data.Data));
                if (detect != null)
                {
                    DetectedEmpoweredAttacks.Remove(detect);
                }
            }

            OnEmpoweredAttackDetected.Invoke(data);
            DetectedEmpoweredAttacks.Add(data);
        }