예제 #1
0
 public static TaskDialogAbstract GetTask(TaskDialog taskDialog, int taskScore, Player player)
 {
     switch (taskDialog)
     {
         case TaskDialog.Bear:
             return new BearTask(player.Name, player.Score);
         case TaskDialog.Make:
             return new MakeTask(taskScore,player.Name,player.Score);
         case TaskDialog.Refuse:
             return new RefuseTask(taskScore);
         case TaskDialog.RefuseAndMove:
             return new RefuseAndMoveTask(player.Name, player.Score);
         default: throw new NotImplementedException();
     }
 }
예제 #2
0
 public void ShowDialogOnButtonClick(TaskDialog taskDialog, Player currentPlayer)
 {
     var task = ShowDialogTask (taskDialog, currentPlayer);
     task.RunSynchronously();
 }
예제 #3
0
        private Task ShowDialogTask(TaskDialog taskDialog, Player currentPlayer)
        {
            var fragmentTransaction = FragmentManager.BeginTransaction();
            var prev = FragmentManager.FindFragmentByTag("answer");
            if (prev != null) fragmentTransaction.Remove(prev);
            int taskScore = Rep.Instance.Tasks.Current.Score;
            var dialog = new TaskProgressDialog (taskDialog, currentPlayer, taskScore) { ShowsDialog = true };
            dialog.Show (fragmentTransaction, "answer");

            _isRefusing = taskDialog == TaskDialog.Refuse;
            return !_isRefusing && !_taskEnumerator.MoveNext ()
                ? new Task (EndOfGame)
                : new Task (MoveNextStep);
        }
예제 #4
0
 public GameFragment(Player player)
 {
     _player = player;
 }
예제 #5
0
 public TaskProgressDialog(TaskDialog taskDialog, Player currentPlayer, int taskScore)
 {
     _taskDialog = taskDialog;
     _currentPlayer = currentPlayer;
     _taskScore = taskScore;
 }