Inherits from NSObject
Declared in PCGPathFinder.h
PCGPathFinder.m

Overview

The PCGPathFinder is an abstract class that defines methods used to find a path in a PCGDirectedGraph.

This class should not be instantiated; instead, one of its subcass should be used (e.g.: PCGPathFinderDijkstra).

Class Methods

pathFinder

Creates, initialises and returns an PCGPathFinder object.

+ (instancetype)pathFinder

Return Value

a PCGPathFinder

Discussion

This method should be called using a PCGPathFinder subclass:

PCGPathFinder *pathFinder = [PCGPathFinderDijkstra pathFinder];

Declared In

PCGPathFinder.h

Instance Methods

findPathInGraph:fromVertex:toVertex:

Perform a search in the specified graph for a (shortest) path between the specified source and target vertices.

- (PCGPath *)findPathInGraph:(PCGDirectedGraph *)graph fromVertex:(PCGVertex)source toVertex:(PCGVertex)target

Parameters

graph

The PCGDirectedGraph

source

The source vertex

target

The target vertex

Return Value

a PCGPath

Declared In

PCGPathFinder.h

findPathInGraph:fromVertex:toVertexPassingTest:

Perform a search in the specified graph for a (shortest) path between the specified source vertex and an other vertex that pass the test in the specified predicate block.

- (PCGPath *)findPathInGraph:(PCGDirectedGraph *)graph fromVertex:(PCGVertex)source toVertexPassingTest:(PCGGVertexPredicate)predicate

Parameters

graph

The PCGDirectedGraph

source

The source vertex

predicate

The predicate block

Return Value

a PCGPath

Declared In

PCGPathFinder.h

init

Initialises and returns an PCGPathFinder object.

- (instancetype)init

Return Value

a PCGPathFinder

Discussion

This method should be called using a PCGPathFinder subclass:

PCGPathFinder *pathFinder = [[PCGPathFinderDijkstra alloc] init];

Declared In

PCGPathFinder.h