public List <Node> PushPath(Node start, Node end) { // Make sure the nodes are in the player island if (!_playerIsland.Contains(start) || !_playerIsland.Contains(end)) { return(new List <Node>()); } var nodes = new HashSet <Node>(); var path = new List <Node>(); Island.FindPath(start, end, nodes, path); path.Reverse(); return(path); }
public void MoveTo(Node node) { PullPosition = node.Position; _playerIsland = _islandSet.Get(node); UpdateState(); }
/// <summary> /// Joins this island with another. /// </summary> /// <returns> /// The island passed as a parameter, now /// containing the union of both node sets. /// </returns> public Island Join(Island island) { island.ConnectedNodes.UnionWith(ConnectedNodes); island._connectedFields.UnionWith(_connectedFields); return(island); }