Пример #1
0
        void Update()
        {
            // check if we need to get a new task
            if (currentTask == null && queuedTasks.Count != 0)
            {
                currentTask = queuedTasks.Dequeue();
                currentTask.Start(this);
            }

            // run the current task
            if (currentTask != null)
            {
                if (currentTask.Update(this))
                {
                    currentTask = null;
                }
            }
        }
Пример #2
0
 /**
  * Tells the crew member to go into another room
  */
 public void QueueTask(ICrewTask task)
 {
     queuedTasks.Enqueue(task);
 }