Ejemplo n.º 1
0
        public IWaypointTask LoadTask(string taskName, XmlNode node)
        {
            if (!taskName.Contains("Task"))
            {
                taskName += "Task";
            }

            taskName.Replace(" ", "");

            switch (taskName.ToLower())
            {
            case "cargotask":
                Task = new CargoTask(node);
                break;

            case "colonisetask":
                Task = new ColoniseTask(node);
                break;

            case "invadetask":
                Task = new InvadeTask(node);
                break;

            case "layminestask":
                Task = new LayMinesTask(node);
                break;

            case "scraptask":
                Task = new ScrapTask(node);
                break;

            case "splitmergetask":
                Task = new SplitMergeTask(node);
                break;

            default:
                Task = new NoTask();
                break;
            }

            return(Task);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Copy Constructor.
 /// </summary>
 /// <param name="other">CargoTask to copy.</param>
 public CargoTask(CargoTask copy)
 {
     Amount = new Cargo(copy.Amount);
     Mode   = copy.Mode;
 }