TKGridGraphNode Class Reference

Inherits from GKGridGraphNode
Declared in TKGridGraphNode.h

Overview

Subclass of GKGridGraphNode used by TilemapKit. You can subclass this class, specifically if you want to further customize its associated cost property.

+ nodeWithGridPosition:cost:

Creates a grid graph node with grid position and associated cost value.

+ (nonnull instancetype)nodeWithGridPosition:(vector_int2)gridPosition cost:(float)cost

Parameters

gridPosition

The node’s position in grid coordinates.

cost

The cost to travel to this node.

Return Value

An instance of TKGridGraphNode.

Declared In

TKGridGraphNode.h

  cost

The cost associated with the node. The default implementation of [GKGridGraphNode costToNode:] will simply return this value.

@property (nonatomic) float cost

Declared In

TKGridGraphNode.h