Esempio n. 1
0
        public static async Task SendCommandB(BeatmapEventData data, HSB hsbColor, double brightness, HSB inithsbColor, HSB endhsbColor, double time, bool gradient)
        {
            CancellationToken  token    = LightInfo.token;
            EntertainmentLayer entLayer = LightInfo.layer;

            if (gradient == true)
            {
                switch (data.value)
                {
                case 0: entLayer.GetBack().SetState(token, null, brightness); break;

                case 1: entLayer.GetBack().SetState(token, inithsbColor.GetRGB(), 1); await Task.Delay(TimeSpan.FromMilliseconds(20), token); entLayer.SetState(token, endhsbColor.GetRGB(), 1, TimeSpan.FromSeconds(time)); break;

                case 5: entLayer.GetBack().SetState(token, inithsbColor.GetRGB(), 1); await Task.Delay(TimeSpan.FromMilliseconds(20), token); entLayer.SetState(token, endhsbColor.GetRGB(), 1, TimeSpan.FromSeconds(time)); break;
                }
            }
            else
            {
                switch (data.value)
                {
                case 0: entLayer.GetBack().SetState(token, null, brightness); break;

                case 1: entLayer.GetBack().SetState(token, hsbColor.GetRGB(), 1); break;

                case 2: entLayer.GetBack().SetState(token, hsbColor.GetRGB(), 1); await Task.Delay(TimeSpan.FromMilliseconds(20), token); entLayer.GetBack().SetState(token, hsbColor.GetRGB(), brightness, TimeSpan.FromSeconds(1)); break;

                case 3: entLayer.GetBack().SetState(token, hsbColor.GetRGB(), 1); await Task.Delay(TimeSpan.FromMilliseconds(20), token); entLayer.GetBack().SetState(token, hsbColor.GetRGB(), brightness, TimeSpan.FromSeconds(1)); break;

                case 5: entLayer.GetBack().SetState(token, hsbColor.GetRGB(), 1); break;

                case 6: entLayer.GetBack().SetState(token, hsbColor.GetRGB(), 1); await Task.Delay(TimeSpan.FromMilliseconds(20), token); entLayer.GetBack().SetState(token, hsbColor.GetRGB(), brightness, TimeSpan.FromSeconds(1)); break;

                case 7: entLayer.GetBack().SetState(token, hsbColor.GetRGB(), 1); await Task.Delay(TimeSpan.FromMilliseconds(20), token); entLayer.GetBack().SetState(token, hsbColor.GetRGB(), brightness, TimeSpan.FromSeconds(1)); break;
                }
            }
        }