Example #1
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            // TODO: Add your update logic here
            //asi.update();
            kvStore.set("Test", rotation++);
            kvStore.update(store);
            srcRect   = new Rectangle(0, 0, 338, 338);
            srcRect.Y = 520;
            dstRect   = new Rectangle(0, 0, 338, 338);

            base.Update(gameTime);
        }
Example #2
0
        private void handleNewData(JObject message, IPEndPoint sender)
        {
            JToken data = message["data"];

            if ((string)data["_UNITTYPE"] == kvStore.AircraftType)
            {
                //Console.WriteLine("new data for {0} received", kvStore.AircraftType);
                //Console.WriteLine(data);
                Dictionary <string, object> kvData = JsonConvert.DeserializeObject <Dictionary <string, object> >(data.ToString());
                foreach (var pair in kvData)
                {
                    kvStore.set(pair.Key, pair.Value);
                }
            }
            else
            {
                Console.WriteLine("unit type is not {0}. Ignoring", kvStore.AircraftType);
            }
        }