Пример #1
0
        public static void LoadEnemy(int buttonid, MachineButtonItem button, MachineRelayItem light)
        {
            var hitButon = new HitButon(buttonid, button, light);

            switch (buttonid)
            {
            case 14:
            case 15:
            case 16:
            case 17:
            case 18:
            case 19:
            case 20:
                hitButon.Sound = string.Empty;
                break;

            case 1:
            case 2:
            case 3:
            case 4:
            case 21:
            case 23:
            case 26:
                hitButon.Sound = "d.wav";
                break;

            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
                hitButon.Sound = "soldier.mp3";
                break;

            case 22:
            case 24:
            case 27:
            case 28:
            case 29:
                hitButon.Sound = "heavy.mp3";
                break;

            case 11:
            case 12:
            case 13:
            case 25:
            case 30:
                hitButon.Sound = "assassin.mp3";
                break;
            }
            Hitters.Add(hitButon);
        }
Пример #2
0
        public async Task Hit(HitButon button)
        {
            if (null == _currentButtons)
            {
                return;
            }
            if (button == _hittedbutton)
            {
                return;
            }
            _hittedbutton = button;
            var hitter = _currentButtons.FirstOrDefault(b => (b.Hitter.Number == button.Hitter.Number) && (b.Hitter.DeviceNumber == button.Hitter.DeviceNumber));
            var task   = hitter;

            if (task != null)
            {
                await task.Hit();

                WriteLog($"{_gameCouting.ElapsedMilliseconds} : {button.ButtonId}, hitted <<<<<<<<");
                //await Checking();
            }
        }