Class CompassGameStateManager
A class to manage the Compass's internal game state data.
Inheritance
Implements
Namespace: Phoenix.Controls.Compass
Assembly: Phoenix.Controls.Compass.dll
Syntax
public class CompassGameStateManager : BindableBase, IDisposable
Constructors
View SourceCompassGameStateManager(CompassViewModel, ICompassGameStateClient, IPhoenixLogger, String, IDevice)
Initializes a new instance of the CompassGameStateManager class.
Declaration
public CompassGameStateManager(CompassViewModel compass, ICompassGameStateClient gameStateClient, IPhoenixLogger logger, string loggerPrefix, IDevice device = null)
Parameters
Type | Name | Description |
---|---|---|
CompassViewModel | compass | The compass to display objects on. |
ICompassGameStateClient | gameStateClient | The game state client to connect to. |
IPhoenixLogger | logger | The logger. |
System.String | loggerPrefix | The prefix to use for the logger. |
IDevice | device | The device. |
Properties
View SourceConnected
Gets a value indicating whether the compass is connected.
Declaration
public bool Connected { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ConnectionStatus
Gets the connection status string.
Declaration
public string ConnectionStatus { get; }
Property Value
Type | Description |
---|---|
System.String |
GameStateClient
Gets the game state client.
Declaration
public ICompassGameStateClient GameStateClient { get; }
Property Value
Type | Description |
---|---|
ICompassGameStateClient |
InternalGameStateDataAvailable
Gets a value indicating whether game state data is available via the Compass Game State Client. Used in xaml.
Declaration
public bool InternalGameStateDataAvailable { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ObjectTypes
Gets the list of object types available to track from the game state.
Declaration
public List<CompassObjectType> ObjectTypes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<CompassObjectType> |
PlayerRefreshRate
Gets the players actual refresh rate based on the refresh string and the time span type. Used in xaml.
Declaration
public TimeSpan? PlayerRefreshRate { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.TimeSpan> |
PlayerRefreshRateString
Gets or sets the current the string representing the refresh rate. Used in xaml.
Declaration
public string PlayerRefreshRateString { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PlayerRefreshRateType
Gets or sets the current time span type the player's refresh rate is using. Used in xaml.
Declaration
public TimeSpanType PlayerRefreshRateType { get; set; }
Property Value
Type | Description |
---|---|
TimeSpanType |
UsePlayerData
Gets or sets a value indicating whether to update the player data via the game state.
Declaration
public bool UsePlayerData { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
View SourceCancelUpdateLoop()
Cancels the update loop for checking for new game state data.
Declaration
public void CancelUpdateLoop()
CreateCompassClient()
Creates the compass client.
Declaration
public async Task CreateCompassClient()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task. |
Dispose()
Declaration
public void Dispose()
InitializeData()
Ask the game state client for available object types as well as player data.
Declaration
public async Task<bool> InitializeData()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | Whether or not the game state client was accessible. |
StartUpdateLoop()
Starts the update loop for checking for new game state data.
Declaration
public void StartUpdateLoop()
UpdateData()
Update the object data from the game state client.
Declaration
public async Task<bool> UpdateData()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | Returns a boolean of whether or not the data from the game state was successfully updated. |
UpdatePlayerData()
Ask the game state client for the current player data.
Declaration
public async Task UpdatePlayerData()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task. |