public static Intent CreatePauseGameDialog(GameActivity activity, string name) { bool isMe = string.IsNullOrEmpty(name); string title, nameText, message, posText, negText; EventHandler posAction, negAction; if(isMe) { nameText = activity.Resources.GetString(Resource.String.you); posText = activity.Resources.GetString(Resource.String.resume); posAction = delegate {activity.ResumeGame();}; negText = activity.Resources.GetString(Resource.String.menu); negAction = delegate {activity.Finish();}; } else { nameText = name; posText = string.Empty; posAction = null; negText = activity.Resources.GetString(Resource.String.menu); negAction = delegate {activity.Finish();}; } title = activity.Resources.GetString(Resource.String.pause); message = string.Format(activity.Resources.GetString(Resource.String.pauseBy, nameText)); return DialogActivity.CreateYesNoDialog(activity, title, message, posText, negText, posAction, negAction); }
private static Intent CreateGameOverDialog(GameActivity activity, string message, TetrisColor messageColor) { string title = activity.Resources.GetString(Resource.String.gameOver); string posText = activity.Resources.GetString(Resource.String.playAgain); string negText = activity.Resources.GetString(Resource.String.menu); return DialogActivity.CreateYesNoDialog(activity, title, message, posText, negText, delegate {activity.NewGame();}, delegate {activity.Finish();}); }