예제 #1
0
        public async Task Do(BoxtanaAction boxtanaAction)
        {
            if (AnimationManager.IsAnimating(OuterGrid) ||
                AnimationManager.IsAnimating(InnerGrid))
            {
                AnimationManager.PauseAnimations(InnerGrid);
                AnimationManager.PauseAnimations(OuterGrid);
                var tasks = new Task[]
                {
                    OuterGrid.AnimateAsync(new SlowResetAnimation()),
                    InnerGrid.AnimateAsync(new SlowResetAnimation()),
                };
                await Task.WhenAll(tasks);

                AnimationManager.StopAnimations(InnerGrid);
                AnimationManager.StopAnimations(OuterGrid);
                AnimationManager.StopAnimations(Inner);
                AnimationManager.StopAnimations(Outer);
            }

            switch (boxtanaAction)
            {
            case BoxtanaAction.Entrance:
                await Entrance1();

                break;

            case BoxtanaAction.Exit:
                await Exit1();

                break;

            case BoxtanaAction.Abashed:
                await Abashed1();

                break;

            case BoxtanaAction.Thinking:
                await Thinking1();

                break;

            case BoxtanaAction.RandomWait:
                await RandomWait(3);

                break;

            case BoxtanaAction.Swing:
                await Swing1();

                break;

            case BoxtanaAction.RotateRight:
                await Rotation(true);

                break;

            case BoxtanaAction.RotateLeft:
                await Rotation(false);

                break;

            case BoxtanaAction.Pulse:
                await Pulse();

                break;

            case BoxtanaAction.Color:
                await Color1();

                break;

            case BoxtanaAction.Jump:
                await Jump();

                break;
            }
        }