Collapse All Expand All

C#

Clarion Library 6.1.1
World..::..GetAgent Method (IComparable)
World Class See Also Send Feedback

[This is preliminary documentation and is subject to change.]

Gets an agent with the specified name. If an agent cannot be found, this method returns null.

Namespace: Clarion
Assembly: ClarionLibrary (in ClarionLibrary.dll) Version: 6.1.1.0 (6.1.1.0)

# Syntax

C#
    public static Agent GetAgent(
    	IComparable name
    )

#### Parameters

name
  Type: System..::..IComparable
  The name of an agent to get

#### Return Value

An agent with the specified name or null if an agent cannot be found

# Remarks

Caution
This method CANNOT guarantee correct retrieval unless ALL agents are initialized using a unique name. Since a name is optional for an agent and since multiple agents can have the same name, calling this method will only returns the FIRST instance of an agent with the specified name (if one is found). Keep this in mind if you plan to use this method to retrieve agents from the world.

# Exceptions

Exception | Condition
--- | ---
System..::..InvalidOperationException | If the singleton world instance has not been initialized

# See Also

World Class
GetAgent Overload
Clarion Namespace