GKGraph Class

Definition

A mathematical graph used for navigability and pathfinding.

``````[Foundation.Register("GKGraph", true)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.MacOSX, 10, 11, ObjCRuntime.PlatformArchitecture.Arch64, null)]
public class GKGraph : Foundation.NSObject, Foundation.INSCopying, Foundation.INSSecureCoding, IDisposable``````
``````type GKGraph = class
inherit NSObject
interface INSCoding
interface INativeObject
interface IDisposable
interface INSCopying
interface INSSecureCoding``````
Inheritance
GKGraph
Derived
Attributes
Implements

Remarks

The following demonstrates pathfinding on a simple graph:

``````
var a = GKGraphNode2D.FromPoint (new Vector2 (0, 5));
var b = GKGraphNode2D.FromPoint (new Vector2 (3, 0));
var c = GKGraphNode2D.FromPoint (new Vector2 (2, 6));
var d = GKGraphNode2D.FromPoint (new Vector2 (4, 6));
var e = GKGraphNode2D.FromPoint (new Vector2 (2, 5));
var f = GKGraphNode2D.FromPoint (new Vector2 (2, 2));
a.AddConnections (new [] { b, c }, false);
b.AddConnections (new [] { e, f }, false);
c.AddConnections (new [] { d }, false);
d.AddConnections (new [] { e, f }, false);
var graph = GKGraph.FromNodes(new [] { a, b, c, d, e, f });
``````var a2e = graph.FindPath (a, e); // [ a, c, d, e ]
var a2f = graph.FindPath (a, f); // [ a, b, f ]
``````

Constructors

 Default constructor, initializes a new instance of this class. Creates a GKGraph with the specified `nodes`. A constructor used when creating managed representations of unmanaged objects; Called by the runtime. A constructor that initializes the object from the data stored in the unarchiver object. Constructor to call on derived classes to skip initialization and merely allocate the object.

Properties

 (Inherited from NSObject) The handle for this class. A developer-meaningful description of this object. (Inherited from NSObject) Description of the object, the Objective-C version of ToString. (Inherited from NSObject) Handle (pointer) to the unmanaged object representation. (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) The GKGraphNode objects defining the graph. Returns the current Objective-C retain count for the object. (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) Handle used to represent the methods in the base class for this NSObject. (Inherited from NSObject) (Inherited from NSObject)

Methods

 Adds `nodes` to Nodes. Registers an object for being observed externally (using NSString keyPath).   Observed changes are dispatched to the observer’s object ObserveValue(NSString, NSObject, NSDictionary, IntPtr) method. (Inherited from NSObject) Registers an object for being observed externally (using string keyPath).   Observed changes are dispatched to the observer’s object ObserveValue(NSString, NSObject, NSDictionary, IntPtr) method. (Inherited from NSObject) Registers an object for being observed externally using an arbitrary method. (Inherited from NSObject) Registers an object for being observed externally using an arbitrary method. (Inherited from NSObject) Called after the object has been loaded from the nib file. Overriders must call base.AwakeFromNib(). (Inherited from NSObject) (Inherited from NSObject) Invokes asynchrously the specified code on the main UI thread. (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) Invoked to determine if this object implements the specified protocol. (Inherited from NSObject) Adds `node` to Nodes and connects it to the existing T:GameplayKit.GKNode to which the connection is the least expensive. Performs a copy of the underlying Objective-C object. (Inherited from NSObject) Performs a copy of the underlying Objective-C object. (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) Indicates a change occurred to the indexes for a to-many relationship. (Inherited from NSObject) (Inherited from NSObject) Indicates that a change occurred on the specified key. (Inherited from NSObject) Releases the resources used by the NSObject object. (Inherited from NSObject) Releases the resources used by the NSObject object. (Inherited from NSObject) Indicates that this object does not recognize the specified selector. (Inherited from NSObject) Encodes the state of the object on the provided encoder (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) T:GamplayKit.GKGraphNode Factory method to create a GKGraph with the specified `nodes`. (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) Retrieves the values of the specified keys. (Inherited from NSObject) Generates a hash code for the current instance. (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) Invokes synchrously the specified code on the main UI thread. (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) Promotes a regular peer object (IsDirectBinding is true) into a toggleref object. (Inherited from NSObject) Creates a mutable copy of the specified NSObject. (Inherited from NSObject) (Inherited from NSObject) Indicates that the value at the specified keyPath relative to this object has changed. (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) Invokes the selector on the current instance and if the `obj` is not null, it passes this as its single parameter. (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) Removes `nodes` from Nodes. Stops the specified observer from receiving further notifications of changed values for the specified keyPath. (Inherited from NSObject) Stops the specified observer from receiving further notifications of changed values for the specified keyPath and context. (Inherited from NSObject) Stops the specified observer from receiving further notifications of changed values for the specified keyPath. (Inherited from NSObject) Stops the specified observer from receiving further notifications of changed values for the specified keyPath and context. (Inherited from NSObject) Whether this object recognizes the specified selector. (Inherited from NSObject) (Inherited from NSObject) Sets the value of the specified key to null. (Inherited from NSObject) Sets the value of the property specified by the key to the specified value. (Inherited from NSObject) A constructor used when creating managed representations of unmanaged objects; Called by the runtime. (Inherited from NSObject) Sets the value of a property that can be reached using a keypath. (Inherited from NSObject) Indicates an attempt to write a value to an undefined key. If not overridden, raises an NSUndefinedKeyException. (Inherited from NSObject) Sets the values of this NSObject to those in the specified dictionary. (Inherited from NSObject) Returns a string representation of the value of the current instance. (Inherited from NSObject) (Inherited from NSObject) (Inherited from NSObject) Returns the value of the property associated with the specified key. (Inherited from NSObject) Returns the value of a property that can be reached using a keypath. (Inherited from NSObject) Indicates an attempt to read a value of an undefined key. If not overridden, raises an NSUndefinedKeyException. (Inherited from NSObject) Indicates that the values of the specified indices in the specified key are about to change. (Inherited from NSObject) (Inherited from NSObject) Indicates that the value of the specified key is about to change. (Inherited from NSObject)

Extension Methods

 Gets the array of UIAccessibilityCustomRotor objects appropriate for `this` object. Sets the array of UIAccessibilityCustomRotor objects appropriate for `this` object.