Exemple #1
0
        public override void Initialize()
        {
            this.Description = "Haul " + item.Name;
            base.Initialize();
            WalkTo w = new WalkTo(item.X, item.Y);

            this.Subtasks.Enqueue(w);
            Pickup p = new Pickup();

            this.Subtasks.Enqueue(p);
            WalkTo a = new WalkTo(dest.X, dest.Y);

            this.Subtasks.Enqueue(a);
            Drop d = new Drop();

            this.Subtasks.Enqueue(d);
        }
Exemple #2
0
        public override void Initialize()
        {
            base.Initialize();
            this.WorkType = WorkTypes.Construction;
            ObtainItem o = new ObtainItem();

            o.CompletedAction = new Action(() => b.MainMaterial = new Materials.PlainMaterial {
                MaterialColor = o.GetItem().MaterialColor
            });
            WalkTo w = new WalkTo(b.X, b.Y);
            Drop   d = new Drop();

            d.Destroy = true;
            DoWork dw = new DoWork();

            dw.Description = "constructing";
            dw.WorkLeft    = (b as Interfaces.IWorkable).WorkRequired;
            dw.Target      = b as Interfaces.IWorkable;
            this.Subtasks.Enqueue(o);
            this.Subtasks.Enqueue(w);
            this.Subtasks.Enqueue(d);
            this.Subtasks.Enqueue(dw);
        }
Exemple #3
0
        public override void Initialize()
        {
            base.Initialize();
            foreach (Stockpile pile in Actor.ParentMap.Stockpiles)
            {
                item = pile.FindItem(this.Filter);
                if (item != null)
                {
                    break;
                }
            }
            if (item == null)
            {
                this.State    = Interfaces.TaskState.Suspended;
                SuspendReason = "Needs material.";
                return;
            }
            WalkTo w = new WalkTo(item.X, item.Y);

            this.Subtasks.Enqueue(w);
            Pickup p = new Pickup();

            this.Subtasks.Enqueue(p);
        }