예제 #1
0
    public void PathFindShortestNoDirt()
    {
        Pathfinder pf = FindObjectOfType(typeof(Pathfinder)) as Pathfinder;

        m_path = new Stack <Vector3>();
        m_path = pf.BreadthFirstSearch(start, end, world.m_chunk, false);
        m_shortestPath.Clear();
        while (m_path.Count > 0)
        {
            m_shortestPath.Add(m_path.Pop());
        }
    }
예제 #2
0
    private bool ResetPath()
    {
        path = pathfindingRef.BreadthFirstSearch();

        if (path.Count == 0)
        {
            return(false);
        }

        nextTile      = path.Pop();
        numStructures = spawnManagerRef.spawnedStructures.Count;
        return(true);
    }
예제 #3
0
        public void ProcessTileSelection(HexTile node)
        {
            this.path = Pathfinder.BreadthFirstSearch(playerActor.InhabitedNode, node);

            ProcessTurn();

            //if (node.inhabitingActor == null) {
            //    this.playerActor.GetComponent<Engine.Actions.ActionQueue>().AddToFront(MoveToNode.CreateComponent(this.playerActor.gameObject, this.playerActor.InhabitedNode, node));
            //    Debug.Log("Travelling to destination!");
            //}
            //else {
            //    // Logic for happens when the actor is clicked is delegated to that actor.
            //    if(node.inhabitingActor is MonsterParty) {
            //        EngineEventManager.Instance().TransitionGameState(Engine.GameStates.Transitions.GameState.Battle, LoadSceneMode.Additive);
            //        Destroy(node.inhabitingActor.gameObject);
            //        node.inhabitingActor = null;
            //    }
            //}
        }