Package apple.gameplaykit
Class GKObstacleGraph<_NodeType>
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.gameplaykit.GKGraph
-
- apple.gameplaykit.GKObstacleGraph<_NodeType>
-
- All Implemented Interfaces:
NSCoding,NSCopying,NSSecureCoding,NSObject
public class GKObstacleGraph<_NodeType> extends GKGraph
A collection of GKGraphNodes that are governed by a set of extruded GKPolygonObstacles
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedGKObstacleGraph(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean_supportsSecureCoding()This property must return YES on all classes that allow secure coding.static booleanaccessInstanceVariablesDirectly()voidaddObstacles(NSArray<? extends GKPolygonObstacle> obstacles)Adds obstacles to this graph.static GKObstacleGraph<?>alloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)floatbufferRadius()The distance by which all obstacles are extruded.static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static NSArray<java.lang.String>classFallbacksForKeyedArchiver()org.moe.natj.objc.ClassclassForGenericArgumentAtIndex(long index)Returns the class of the specified generic indexstatic org.moe.natj.objc.ClassclassForKeyedUnarchiver()voidconnectNodeUsingObstacles(GKGraphNode2D node)Connects the node to this graph by testing edge intersection with existing obstacles.voidconnectNodeUsingObstaclesIgnoringBufferRadiusOfObstacles(GKGraphNode2D node, NSArray<? extends GKPolygonObstacle> obstaclesBufferRadiusToIgnore)Same behavior as connectNodeUsingObstacles: except you can optionally ignore the bounding radius of certain obstacles from being tested for intersectionvoidconnectNodeUsingObstaclesIgnoringObstacles(GKGraphNode2D node, NSArray<? extends GKPolygonObstacle> obstaclesToIgnore)Same behavior as connectNodeUsingObstacles: except you can optionally ignore certain obstacles from being tested for intersection.static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()static GKObstacleGraph<?>graphWithNodes(NSArray<? extends GKGraphNode> nodes)static <_NodeType>
GKObstacleGraph<?>graphWithObstaclesBufferRadius(NSArray<? extends GKPolygonObstacle> obstacles, float bufferRadius)Creates an optimal bidirectional graph based on a list of obstacles.static <_NodeType>
GKObstacleGraph<?>graphWithObstaclesBufferRadiusNodeClass(NSArray<? extends GKPolygonObstacle> obstacles, float bufferRadius, org.moe.natj.objc.Class nodeClass)Creates an optimal bidirectional graph based on a list of obstacles.static longhash_static()GKObstacleGraph<?>init()GKObstacleGraph<?>initWithCoder(NSCoder coder)NS_DESIGNATED_INITIALIZERGKObstacleGraph<?>initWithNodes(NSArray<? extends GKGraphNode> nodes)GKObstacleGraph<?>initWithObstaclesBufferRadius(NSArray<? extends GKPolygonObstacle> obstacles, float bufferRadius)GKObstacleGraph<?>initWithObstaclesBufferRadiusNodeClass(NSArray<? extends GKPolygonObstacle> obstacles, float bufferRadius, org.moe.natj.objc.Class nodeClass)static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)booleanisConnectionLockedFromNodeToNode(GKGraphNode2D startNode, GKGraphNode2D endNode)Query if a given connection is lockedstatic booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)voidlockConnectionFromNodeToNode(GKGraphNode2D startNode, GKGraphNode2D endNode)Marks a connection as "locked", preventing this connection from being destroyed when you add obstacles that would intersect itstatic java.lang.Objectnew_objc()NSArray<? extends GKGraphNode2D>nodesForObstacle(GKPolygonObstacle obstacle)Returns an array of the graph nodes associated with a given obstacleNSArray<? extends GKPolygonObstacle>obstacles()Array of the extruded obstacles currently represented by this graphvoidremoveAllObstacles()Removes all obstacles from this graph.voidremoveObstacles(NSArray<? extends GKPolygonObstacle> obstacles)Removes obstacles from this graph.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)static voidsetVersion_static(long aVersion)static org.moe.natj.objc.Classsuperclass_static()static booleansupportsSecureCoding()voidunlockConnectionFromNodeToNode(GKGraphNode2D startNode, GKGraphNode2D endNode)"Unlocks" a connection, removing its protection from being destroyed when you add obstacles that would intersect itstatic longversion_static()-
Methods inherited from class apple.gameplaykit.GKGraph
addNodes, connectNodeToLowestCostNodeBidirectional, copyWithZone, encodeWithCoder, findPathFromNodeToNode, nodes, removeNodes
-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static GKObstacleGraph<?> alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
graphWithNodes
public static GKObstacleGraph<?> graphWithNodes(NSArray<? extends GKGraphNode> nodes)
-
graphWithObstaclesBufferRadius
public static <_NodeType> GKObstacleGraph<?> graphWithObstaclesBufferRadius(NSArray<? extends GKPolygonObstacle> obstacles, float bufferRadius)
Creates an optimal bidirectional graph based on a list of obstacles. Each vertex of each obstacle is extruded and a connection is made between each vertex that does not intersect an obstacle Guaranteed not to have any edges which intersect obstacles. Same effect as [[GKObstacleGraph alloc] init], setting bufferRadius, and then calling addObstacles.- Parameters:
obstacles- a list of obstacles to create the graph frombufferRadius- the circular radius of a potential agent that will navigate this graph. Obstacles are extruded by this amount to create the graph. Must be positive. Negative values are clipped to 0.0f
-
graphWithObstaclesBufferRadiusNodeClass
public static <_NodeType> GKObstacleGraph<?> graphWithObstaclesBufferRadiusNodeClass(NSArray<? extends GKPolygonObstacle> obstacles, float bufferRadius, org.moe.natj.objc.Class nodeClass)
Creates an optimal bidirectional graph based on a list of obstacles. Each vertex of each obstacle is extruded and a connection is made between each vertex that does not intersect an obstacle Guaranteed not to have any edges which intersect obstacles. Same effect as [[GKObstacleGraph alloc] init], setting bufferRadius, and then calling addObstacles.- Parameters:
obstacles- a list of obstacles to create the graph frombufferRadius- the circular radius of a potential agent that will navigate this graph. Obstacles are extruded by this amount to create the graph. Must be positive. Negative values are clipped to 0.0fnodeClass- the class of the nodes that this graph should create. Must descend from GKGraphNode2D
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
new_objc
public static java.lang.Object new_objc()
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
addObstacles
public void addObstacles(NSArray<? extends GKPolygonObstacle> obstacles)
Adds obstacles to this graph. Obstacle is extruded and graph nodes are generated from its vertices and then connected to this graph Nothing is done if an obstacle is already present in this graph Any existing connections that intersect the new obstacles are destroyed unless they are protected with [GKObstacleGraph lockConnection:]- Parameters:
obstacles- an array of obstacles to be added- See Also:
lockConnection
-
bufferRadius
public float bufferRadius()
The distance by which all obstacles are extruded. This is most commonly the spatial bounding radius of a potential traveler on this path
-
classForGenericArgumentAtIndex
public org.moe.natj.objc.Class classForGenericArgumentAtIndex(long index)
Returns the class of the specified generic index
-
connectNodeUsingObstacles
public void connectNodeUsingObstacles(GKGraphNode2D node)
Connects the node to this graph by testing edge intersection with existing obstacles. Same behavior as if this node had been present during initWithObstacles.- Parameters:
node- the node to connect
-
connectNodeUsingObstaclesIgnoringBufferRadiusOfObstacles
public void connectNodeUsingObstaclesIgnoringBufferRadiusOfObstacles(GKGraphNode2D node, NSArray<? extends GKPolygonObstacle> obstaclesBufferRadiusToIgnore)
Same behavior as connectNodeUsingObstacles: except you can optionally ignore the bounding radius of certain obstacles from being tested for intersection
-
connectNodeUsingObstaclesIgnoringObstacles
public void connectNodeUsingObstaclesIgnoringObstacles(GKGraphNode2D node, NSArray<? extends GKPolygonObstacle> obstaclesToIgnore)
Same behavior as connectNodeUsingObstacles: except you can optionally ignore certain obstacles from being tested for intersection.
-
init
public GKObstacleGraph<?> init()
-
initWithCoder
public GKObstacleGraph<?> initWithCoder(NSCoder coder)
Description copied from interface:NSCodingNS_DESIGNATED_INITIALIZER- Specified by:
initWithCoderin interfaceNSCoding- Overrides:
initWithCoderin classGKGraph
-
initWithNodes
public GKObstacleGraph<?> initWithNodes(NSArray<? extends GKGraphNode> nodes)
- Overrides:
initWithNodesin classGKGraph
-
initWithObstaclesBufferRadius
public GKObstacleGraph<?> initWithObstaclesBufferRadius(NSArray<? extends GKPolygonObstacle> obstacles, float bufferRadius)
-
initWithObstaclesBufferRadiusNodeClass
public GKObstacleGraph<?> initWithObstaclesBufferRadiusNodeClass(NSArray<? extends GKPolygonObstacle> obstacles, float bufferRadius, org.moe.natj.objc.Class nodeClass)
-
isConnectionLockedFromNodeToNode
public boolean isConnectionLockedFromNodeToNode(GKGraphNode2D startNode, GKGraphNode2D endNode)
Query if a given connection is locked- Parameters:
startNode- startNode of the connection to queryendNode- endNode of the connection to query- Returns:
- YES if the connection was locked with lockConnection, NO if it was never locked or was unlocked via unlockConnection
- See Also:
lockConnection,unlockConnection
-
lockConnectionFromNodeToNode
public void lockConnectionFromNodeToNode(GKGraphNode2D startNode, GKGraphNode2D endNode)
Marks a connection as "locked", preventing this connection from being destroyed when you add obstacles that would intersect it- Parameters:
startNode- startNode of the connection to lockendNode- endNode of the connection to lock
-
nodesForObstacle
public NSArray<? extends GKGraphNode2D> nodesForObstacle(GKPolygonObstacle obstacle)
Returns an array of the graph nodes associated with a given obstacle- Parameters:
obstacle- the obstacle who's nodes are to be retrieved
-
obstacles
public NSArray<? extends GKPolygonObstacle> obstacles()
Array of the extruded obstacles currently represented by this graph
-
removeAllObstacles
public void removeAllObstacles()
Removes all obstacles from this graph.
-
removeObstacles
public void removeObstacles(NSArray<? extends GKPolygonObstacle> obstacles)
Removes obstacles from this graph. All associated graph nodes are removed and their connections are bidirectionally removed. Connections between obstacle nodes that were previously invalidated by any of these obstacles are restored. Nothing is done if an obstacle is already present in this graph- Parameters:
obstacles- an array of obstacles to be removed
-
unlockConnectionFromNodeToNode
public void unlockConnectionFromNodeToNode(GKGraphNode2D startNode, GKGraphNode2D endNode)
"Unlocks" a connection, removing its protection from being destroyed when you add obstacles that would intersect it- Parameters:
startNode- startNode of the connection to unlockendNode- endNode of the connection to unlock- See Also:
lockConnection
-
supportsSecureCoding
public static boolean supportsSecureCoding()
-
_supportsSecureCoding
public boolean _supportsSecureCoding()
Description copied from interface:NSSecureCodingThis property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.- Specified by:
_supportsSecureCodingin interfaceNSSecureCoding- Overrides:
_supportsSecureCodingin classGKGraph
-
-