Type Method

graphFromGridStartingAt:width:height:diagonalsAllowed:

Creates a graph that describes an integer grid with the specified dimensions.

Declaration

+ (instancetype)graphFromGridStartingAt:(vector_int2)position width:(int)width height:(int)height diagonalsAllowed:(BOOL)diagonalsAllowed;

Parameters

position

The lowest x- and y-coordinates to appear in the grid.

width

The number of possible x-coordinates in the grid.

height

The number of possible y-coordinates in the grid.

diagonalsAllowed

YES to connect nodes in the grid to their diagonal neighbors; NO to connect nodes only to their horizontal and vertical neighbors.

Return Value

A new grid graph.

Discussion

All connections created through this method are bidirectional.

See Also

Creating a Graph

- initFromGridStartingAt:width:height:diagonalsAllowed:nodeClass:

Initializes a graph that describes an integer grid with the specified dimensions, using the specified node class.

+ graphFromGridStartingAt:width:height:diagonalsAllowed:nodeClass:

Creates a graph that describes an integer grid with the specified dimensions, using the specified node class.

- initFromGridStartingAt:width:height:diagonalsAllowed:

Initializes a graph that describes an integer grid with the specified dimensions.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software