Beispiel #1
0
 /// <summary>
 /// update taks of npc, if is done, if is new one available,...
 /// </summary>
 private void UpdateTask()
 {
     if ((this.currentTask.checkpoints == null || this.currentTask.checkpoints.Count == 0) &&
         this.taskStack.Count > 0)  //no current task
     {
         this.currentTask = this.taskStack.Pop();
         Logging.Logger.AddImportant("menim currentTask pro npc: " + this.character.name +
                                     " na " + this.currentTask.ToString());
         //if (!this.script)
         //{
         //    this.fsm.React(AiEvents.newTask);
         //}
         //TODO vyresti pridavani tasku
     }
     else if (this.currentTask.result == Result.fail)
     {
         Logger.AddImportant(character.name + " nesplnil cil");
         //this.Die();
     }
     else if (this.currentTask.result == Result.succes && this.taskStack.Count > 0)
     {
         Logger.AddInfo(character.name + " jde na dalsi cil");
         this.currentTask = this.taskStack.Pop();
         //if (!this.script)
         //{
         //    this.fsm.React(AiEvents.newTask);
         //}
     }
     //else if (this.currentTask.checkpoints != null && this.currentTask.checkpoints.Contains(this.GetPosition2D()))
     //{
     //    this.currentTask.checkpoints.Remove(this.GetPosition2D());
     //}
     else if (this.currentTask.checkpoints != null && this.currentTask.checkpoints.Count == 0 && this.currentTask.result != Result.succes)
     {
         this.currentTask.result = Result.succes;
         Logger.AddImportant(this.character.name + " splnil cil");
     }
 }
Beispiel #2
0
 /// <summary>
 /// adds the task into the queqe if tasks
 /// </summary>
 /// <param name="task">task to add</param>
 public void AddTask(NpcTask task)
 {
     this.taskStack.Push(task);
     Logging.Logger.AddInfo("pridavam ukol na zasobnik: " + task.ToString());
 }
 public void AddTask(NpcTask target)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #4
0
 public void AddTask(NpcTask target)
 {
     //senseless
 }