public void arrangeStuffEvent(object source, ElapsedEventArgs e) { try { frameController.activate(frameHand); Console.WriteLine("OHAI!"); } catch (FrameController.InvalidFrameException) { frameController.stow(frameHand); Console.WriteLine("KTHXBAI!"); } }
public override void update(GameTime gameTime) { base.update(gameTime); FrameController controller = GameClient.Instance.frameController; foreach (GestureSample gesture in GestureManager.Gestures) { if (gesture.GestureType == GestureType.Tap) { if (scoreTab.checkForHit(gesture.Position)) { if (IsActive) { controller.stow(this); Console.WriteLine("STOWED"); } else { controller.activate(this); Console.WriteLine("ACTIVATED"); } } } } foreach (Player player in ClientDataStore.Instance.Players) { NineGridRow row = scoreboard.getRow(player.ID.ToString()); row.getCell("score").Text = player.Score.ToString(); row.getCell("bid").Text = (player.Bid == -1 ? "-" : player.Bid.ToString()); row.getCell("tricks").Text = player.TricksWon.ToString(); } }
/// <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> public void Update(GameTime gameTime) { try { if ((ClientDataStore.Instance.CardRequested || frameBid.IsActive) && !playerIndicator.IsActive) { frameController.activate(playerIndicator); } else if (!(ClientDataStore.Instance.CardRequested || frameBid.IsActive) && playerIndicator.IsActive) { frameController.stow(playerIndicator); } frameController.arrange(); frameHand.update(gameTime); frameTable.update(gameTime); frameBid.update(gameTime); frameScoreboard.update(gameTime); playerIndicator.update(gameTime); frameEndgame.update(gameTime); } catch (InvalidOperationException) { Console.WriteLine("CONCURRENT ACCESS WHILE UPDATING"); Update(gameTime); return; } }