public override void MakePreparations(Living l) { //Setup the task to move to the reserved item this.Move = new MoveTask(this.BoundID, this.ReservedItemLocation); this.Move.Completed += this.Move_Completed; this.Move.MakePreparations(l); }
protected static Dependencies GetDependencies(Guid boundID, Point2D target, Guid creatureID) { MoveTask move = new MoveTask(boundID, target, PriorityLayers.SpecificCreature); move.Qualifications.Add(new SpecificCreatureQualification(creatureID)); ObservableCollection <MagicalTask> deps = new ObservableCollection <MagicalTask> { move }; return(new Dependencies(deps)); }
public override bool CreateDependencies(Living l) { List <Point2D> result = WorldUtil.GetNeighboringTiles(this.Target, l.Dimension); result.RemoveAll(x => !World.Data.World.GetTile(l.Dimension, x.X, x.Y).IsWalkable); ComponentSelectable entitySelected = l.GetExactComponent <ComponentSelectable>(); Point2D adjacentLocation = PathUtil.GetFirstReachable(result, entitySelected.MapLocation, l.Dimension); if (adjacentLocation == null) { return(false); } else { MoveTask task = new MoveTask(this.BoundID, adjacentLocation); this.Dependencies.PreRequisite.Add(task); return(true); } }