Beispiel #1
0
        private void SetTime(SkyBoxTime time)
        {
            switch (time)
            {
            case SkyBoxTime.Morning:
                connector.SendPacket(Skybox.SetTime(9), new Action <JObject>(data =>
                {
                    connector.SendPacket(Skybox.Update("static",
                                                       GetSkyBox("bluecloud_rt.jpg"), GetSkyBox("bluecloud_lf.jpg"),
                                                       GetSkyBox("bluecloud_up.jpg"),
                                                       GetSkyBox("bluecloud_dn.jpg"), GetSkyBox("bluecloud_bk.jpg"),
                                                       GetSkyBox("bluecloud_ft.jpg")),
                                         new Action <JObject>(morningData => { Console.WriteLine("It's daytime!"); }));
                }));
                break;

            case SkyBoxTime.Afternoon:
                connector.SendPacket(Skybox.SetTime(12), new Action <JObject>(data =>
                {
                    connector.SendPacket(Skybox.Update("static",
                                                       GetSkyBox("graycloud_rt.jpg"), GetSkyBox("graycloud_lf.jpg"),
                                                       GetSkyBox("graycloud_up.jpg"),
                                                       GetSkyBox("graycloud_dn.jpg"), GetSkyBox("graycloud_bk.jpg"),
                                                       GetSkyBox("graycloud_ft.jpg")),
                                         new Action <JObject>(afternoonData => { Console.WriteLine("It's the afternoon!"); }));
                }));
                break;

            case SkyBoxTime.Evening:
                connector.SendPacket(Skybox.SetTime(20), new Action <JObject>(data =>
                {
                    connector.SendPacket(Skybox.Update("static",
                                                       GetSkyBox("yellowcloud_rt.jpg"), GetSkyBox("yellowcloud_lf.jpg"),
                                                       GetSkyBox("yellowcloud_up.jpg"),
                                                       GetSkyBox("yellowcloud_dn.jpg"), GetSkyBox("yellowcloud_bk.jpg"),
                                                       GetSkyBox("yellowcloud_ft.jpg")),
                                         new Action <JObject>(eveningData => { Console.WriteLine("It's in the evening!"); }));
                }));
                break;

            case SkyBoxTime.Night:
                connector.SendPacket(Skybox.SetTime(22), new Action <JObject>(data =>
                {
                    connector.SendPacket(Skybox.Update("static",
                                                       GetSkyBox("graycloud_rt.jpg"), GetSkyBox("graycloud_lf.jpg"),
                                                       GetSkyBox("graycloud_up.jpg"),
                                                       GetSkyBox("graycloud_dn.jpg"), GetSkyBox("graycloud_bk.jpg"),
                                                       GetSkyBox("graycloud_ft.jpg")),
                                         new Action <JObject>(nightData => { Console.WriteLine("It's nightTime!"); }));
                }));
                break;
            }
        }