예제 #1
0
    public List <Tuple <int, int> > PathFromTo(Tuple <int, int> origin, Tuple <int, int> target)
    {
        if (pathfinder == null)
        {
            pathfinder = new MapPathfinder(this);
        }

        return(pathfinder.GetFastApproximateFullPathFrom(origin, target));
    }
예제 #2
0
    public override List <HexCoordinates> GetTargetSpaces(HexCoordinates source, HexDirection dir, EntityMapping entityMap, TileListBase tileMap, IMapCollisionDetection collide)
    {
        EntityAbilityUser AAUser = AbilityUser as EntityAbilityUser;

        if (AAUser)
        {
            List <HexCoordinates> ret = MapPathfinder.GetAllPathableTiles(entityMap, tileMap, source, AAUser.GetComponent <IEntityMovement>(), collide); //probably not good
            return(ret);
        }
        else
        {
            return(new List <HexCoordinates>());
        }
    }
예제 #3
0
 void Start()
 {
     rb = GetComponent <Rigidbody>();
     //SINGLETON TAL VEZ O SCRIPTABLE OBJECTS
     mapPathfinder = GameObject.FindWithTag("Respawn").GetComponent <MapPathfinder>();
 }
예제 #4
0
 internal static bool CanPath(IMapCollisionDetection map, EntityMapping entityMap, TileListBase tileMap, IEntityMovement actor, HexCoordinates source, HexCoordinates target)
 {
     return (MapPathfinder.GetPath(map, entityMap, tileMap, source, target, actor) != null); //Slow
 }