예제 #1
0
        private static void SetupTaskList(TaskList tasks)
        {
            Task firstTask  = tasks.AddTask("New Task");
            Task secondTask = tasks.AddTask("Another Task");

            tasks.CompleteTask(firstTask.TaskId);
        }
예제 #2
0
        public void CompleteTaskShouldReturnNullIfTaskIdIsNonexistent()
        {
            TaskList tasks        = new TaskList();
            Task     returnedTask = tasks.CompleteTask(42);

            Assert.IsNull(returnedTask, string.Format("Returned task should be null, not {0}", returnedTask));
        }
예제 #3
0
 // TODO check if other is player
 private void OnTriggerEnter(Collider other)
 {
     if (renderer.enabled)
     {
         TaskList.CompleteTask(this.taskID, true);
         Score.AddToScore(pointsWorth);
         StopCoroutine(current);
         renderer.enabled = false;
     }
 }
예제 #4
0
        public void CompleteTaskShouldMarkTaskComplete()
        {
            TaskList tasks   = new TaskList();
            Task     newTask = tasks.AddTask("Task to complete");

            Assert.IsNull(newTask.CompletionDate, "Tasks should not be completed when they are first added.");

            tasks.CompleteTask(newTask.TaskId);
            Assert.IsNotNull(newTask.CompletionDate, "Completing a task needs to add a completion date.");
            Assert.AreEqual <DateTime>(DateTime.Today, newTask.CompletionDate.Value, "Completion date should be today.");
        }
예제 #5
0
    public override void Action(GameObject player)
    {
        TaskList taskList = player.GetComponent <TaskList>();

        taskList.CompleteTask(task);
    }