public NPCController(Character n, List <Vector2> path, bool loop, endBehavior endBehavior = null) { if (n != null) { speed = n.speed; this.loop = loop; puppet = n; this.path = path; setMoving(newTarget: true); behaviorAtEnd = endBehavior; } }
public PathFindController(Character c, GameLocation location, isAtEnd endFunction, int finalFacingDirection, bool eraseOldPathController, endBehavior endBehaviorFunction, int limit, Point endPoint, bool clearMarriageDialogues = true) { this.limit = limit; character = c; NPC npc = c as NPC; if (npc != null && npc.CurrentDialogue.Count > 0 && npc.CurrentDialogue.Peek().removeOnNextMove) { npc.CurrentDialogue.Pop(); } if (npc != null && clearMarriageDialogues) { if (npc.currentMarriageDialogue.Count > 0) { npc.currentMarriageDialogue.Clear(); } npc.shouldSayMarriageDialogue.Value = false; } this.location = location; this.endFunction = ((endFunction == null) ? new isAtEnd(isAtEndPoint) : endFunction); this.endBehaviorFunction = endBehaviorFunction; if (endPoint == Point.Zero) { endPoint = new Point((int)c.getTileLocation().X, (int)c.getTileLocation().Y); } this.finalFacingDirection = finalFacingDirection; if (!(character is NPC) && !isPlayerPresent() && endFunction == new isAtEnd(isAtEndPoint) && endPoint.X > 0 && endPoint.Y > 0) { character.Position = new Vector2(endPoint.X * 64, endPoint.Y * 64 - 32); return; } pathToEndPoint = findPath(new Point((int)c.getTileLocation().X, (int)c.getTileLocation().Y), endPoint, endFunction, location, character, limit); if (pathToEndPoint == null) { _ = (location is FarmHouse); } }
public PathFindController(Character c, GameLocation location, Point endPoint, int finalFacingDirection, endBehavior endBehaviorFunction, int limit) : this(c, location, isAtEndPoint, finalFacingDirection, eraseOldPathController : false, null, limit, endPoint) { this.endPoint = endPoint; this.endBehaviorFunction = endBehaviorFunction; }
public MovementController(Character c, GameLocation location, isAtEnd endFunction, int finalFacingDirection, bool eraseOldPathController, endBehavior endBehaviorFunction, int limit, Point endPoint, bool clearMarriageDialogues = true) : base(c, location, endFunction, finalFacingDirection, eraseOldPathController, endBehaviorFunction, limit, endPoint, clearMarriageDialogues) { }
public MovementController(Character c, GameLocation location, Point endPoint, int finalFacingDirection, endBehavior endBehaviorFunction, int limit) : base(c, location, endPoint, finalFacingDirection, endBehaviorFunction, limit) { }