Interface ICompassGameStateClient
An interface for the compass to gain access to game state data.
Namespace: Phoenix.Controls.Compass
Assembly: Phoenix.Controls.Compass.dll
Syntax
public interface ICompassGameStateClient
Properties
View SourceTitleName
Gets the title that the game state is for.
Declaration
string TitleName { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
View SourceCreateCompassGameStateClient(IDevice)
Create a game state for the given device.
Declaration
Task<bool> CreateCompassGameStateClient(IDevice device)
Parameters
Type | Name | Description |
---|---|---|
IDevice | device | The device the game is running on. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | Returns whether the game state was successfully created. |
GetAllGameObjectsOfClass(String, Nullable<TimeSpan>)
Retrieves all the objects of the given game object class. Objects will need to have a location in the game to be shown on compass.
Declaration
Task<IEnumerable<Tuple<string, Vector3>>> GetAllGameObjectsOfClass(string className, TimeSpan? maxAge = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | className | The name of the class to query for. |
System.Nullable<System.TimeSpan> | maxAge | Max age for cached object data. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.Tuple<System.String, System.Numerics.Vector3>>> | A collection of objects (a unique name and location) of the given type. |
GetPlayerLocation(Int32, Nullable<TimeSpan>)
Gets the player's location.
Declaration
Task<Vector3?> GetPlayerLocation(int playerIndex, TimeSpan? maxAge = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playerIndex | The player index. |
System.Nullable<System.TimeSpan> | maxAge | Max age for cached player data. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Nullable<System.Numerics.Vector3>> | The player's location as a vector3. |
GetPlayerRotation(Int32, Nullable<TimeSpan>)
Gets the player's rotation (most often this is actually the camera rotation). This will be used to rotate the compass.
Declaration
Task<Rotation3?> GetPlayerRotation(int playerIndex, TimeSpan? maxAge = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | playerIndex | The player index. |
System.Nullable<System.TimeSpan> | maxAge | Max age for cached player data. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Nullable<Rotation3>> | The player's rotation as a Rotation3. |
GetRegisteredGameObjectClasses()
Retrieves the names of the game object classes registered with the game state that would want to be shown on the compass. Objects will need to have a location in the game to be shown on compass.
Declaration
Task<IEnumerable<string>> GetRegisteredGameObjectClasses()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.String>> | A collection of names of game object classes. |
IsDisconnectedException(Exception)
Return whether this exception means the title has become disconnect and the compass should start to try to reconnect.
Declaration
bool IsDisconnectedException(Exception ex)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | ex | The exception to check. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the title has become disconnected. |
IsGameStateValid()
Returns whether the game state is currently valid to get information from.
Declaration
Task<bool> IsGameStateValid()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | Boolean of whether the game state is valid. |
Reconnect()
If the compass becomes disconnected from the title it will attempt to reconnect by calling this function.
Declaration
Task<bool> Reconnect()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | Returns whether reconnecting was successful. |