Class CompassViewModel
Visualization using compass to help testers navigate to objects.
Inheritance
Implements
Namespace: Phoenix.Controls.Compass
Assembly: Phoenix.Controls.Compass.dll
Syntax
public class CompassViewModel : BindableBase, IDisposable
Properties
View SourceAdditionalObjectTypes
Gets additional object types to appear in the available object type list. (Recommendations and not GST sources should add types here). Note: key should be the same as the key used in CompassObjectViewModelSets.
Declaration
public Dictionary<string, List<CompassObjectType>> AdditionalObjectTypes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<CompassObjectType>> |
AvailableObjectTypes
Gets the collection of currently available object types that can be shown on the compass.
Declaration
public ObservableCollection<CompassObjectType> AvailableObjectTypes { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<CompassObjectType> |
BackLeftObjects
Gets the back left objects.
Declaration
public ObservableCollection<CompassQueueObject> BackLeftObjects { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<CompassQueueObject> |
BackRightObjects
Gets the back right objects.
Declaration
public ObservableCollection<CompassQueueObject> BackRightObjects { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<CompassQueueObject> |
ColorList
Gets or sets an array of system colors to be used by the UI as a drop down for color selection.
Declaration
public static Array ColorList { get; set; }
Property Value
Type | Description |
---|---|
System.Array |
CompassFilters
Gets the collection of filter objects for the filter table.
Declaration
public ObservableCollection<CompassFilter> CompassFilters { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<CompassFilter> |
CompassObjectViewModels
Gets the compass object view models.
Declaration
public ObservableCollection<CompassObjectViewModel> CompassObjectViewModels { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<CompassObjectViewModel> |
CompassObjectViewModelSets
Gets a dictionary of objects from various compass requests and recommendations.
Declaration
public Dictionary<string, List<CompassObjectViewModel>> CompassObjectViewModelSets { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<CompassObjectViewModel>> |
CompassSettings
Gets the compass settings for this compass.
Declaration
public CompassSettings CompassSettings { get; }
Property Value
Type | Description |
---|---|
CompassSettings |
Device
Gets the device associated with this compass.
Declaration
public IDevice Device { get; }
Property Value
Type | Description |
---|---|
IDevice |
DueEastValue
Gets or sets the East directional offset value in degrees.
Declaration
public int DueEastValue { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Enabled
Gets or sets a value indicating whether the compass should currently be visible.
Declaration
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
GameStateManager
Gets the game state manager for this compass.
Declaration
public CompassGameStateManager GameStateManager { get; }
Property Value
Type | Description |
---|---|
CompassGameStateManager |
HeightBuffer
Gets or sets the height buffer of the compass, updates the setting.
Declaration
public int HeightBuffer { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
IndicatorMaxDistance
Gets or sets the indicator maximum distance of the compass, updates the setting.
Declaration
public int IndicatorMaxDistance { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
IndicatorMinDistance
Gets or sets the indicator minimum distance of the compass, updates the setting.
Declaration
public int IndicatorMinDistance { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
InternalGameStateReconnectDelay
Gets the compass's GST reconnect delay based on the refresh string and the time span type. Used in xaml.
Declaration
public TimeSpan? InternalGameStateReconnectDelay { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.TimeSpan> |
InternalGameStateReconnectDelayTimeSpanString
Gets or sets the current the string representing the reconnect delay for the compass's GST. Used in xaml.
Declaration
public string InternalGameStateReconnectDelayTimeSpanString { get; set; }
Property Value
Type | Description |
---|---|
System.String |
InternalGameStateReconnectDelayTimeSpanType
Gets or sets the current the string representing the reconnect delay for the compass's GST. Used in xaml.
Declaration
public TimeSpanType InternalGameStateReconnectDelayTimeSpanType { get; set; }
Property Value
Type | Description |
---|---|
TimeSpanType |
InternalGameStateUpdateRate
Gets the compass's GST actual refresh rate based on the refresh string and the time span type. Used in xaml.
Declaration
public TimeSpan? InternalGameStateUpdateRate { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.TimeSpan> |
InternalGameStateUpdateRateTimeSpanString
Gets or sets the current the string representing the refresh rate for the compass's GST. Used in xaml.
Declaration
public string InternalGameStateUpdateRateTimeSpanString { get; set; }
Property Value
Type | Description |
---|---|
System.String |
InternalGameStateUpdateRateTimeSpanType
Gets or sets the current the string representing the refresh rate for the compass's GST. Used in xaml.
Declaration
public TimeSpanType InternalGameStateUpdateRateTimeSpanType { get; set; }
Property Value
Type | Description |
---|---|
TimeSpanType |
IsVisible
Gets a value indicating whether the compass is visible.
Declaration
public bool IsVisible { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
LengthScaleFactor
Gets or sets the scale for the length of the compass.
Declaration
public float LengthScaleFactor { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
PlayerGameObject
Gets or sets the player game object.
Declaration
public PlayerGameObject PlayerGameObject { get; set; }
Property Value
Type | Description |
---|---|
PlayerGameObject |
TitleName
Gets or sets the title name associated with this compass.
Declaration
public string TitleName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
TypeColorChangeOccurred
Gets or sets a value indicating whether a type color change has occurred.
Declaration
public bool TypeColorChangeOccurred { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
TypeEnabledStateChanged
Gets or sets a value indicating whether a type's enabled state changed.
Declaration
public bool TypeEnabledStateChanged { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
VisibleWhenEmpty
Gets or sets a value indicating whether the compass should be visible if it is empty.
Declaration
public bool VisibleWhenEmpty { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
View SourceAddNewFilter(String, String, IEnumerable<String>)
Adds a new filter to the filter table for the compass.
Declaration
public void AddNewFilter(string filterName, string filterCategoryName, IEnumerable<string> filterEntries)
Parameters
Type | Name | Description |
---|---|---|
System.String | filterName | The name of the filter object. |
System.String | filterCategoryName | The name of the filter type for this filter object. |
System.Collections.Generic.IEnumerable<System.String> | filterEntries | The collection of filter items for the given filter type. |
AddObjects(List<CompassGameObject>, String, String, Boolean, Boolean)
Creates compass object view models based on the given compass game object list and adds them to the sets of Compass Object VM's.
Declaration
public void AddObjects(List<CompassGameObject> cgoList, string dictionaryKey, string compassSourceName, bool extractAndAddObjectTypes = false, bool enableTypesInCompassByDefault = true)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<CompassGameObject> | cgoList | A list of compass game objects. |
System.String | dictionaryKey | The key to use for adding list of object to a dictionary. |
System.String | compassSourceName | Name of the source this data is coming from to keep type name within object unique. (Ex. Recommendation Name). |
System.Boolean | extractAndAddObjectTypes | Extract object types and add them to the object type list. |
System.Boolean | enableTypesInCompassByDefault | If adding object types specify if they should start enabled. |
CancelGameStateUpdateLoop()
Cancels the update loop for checking for new game state data.
Declaration
public void CancelGameStateUpdateLoop()
CombineCompassObjectViewModelSets()
Combine the compass objects in the dictionary to display on the compass.
Declaration
public void CombineCompassObjectViewModelSets()
Create(String, IPhoenixLogger, String, String, IDevice, ICompassGameStateClient)
Creates a compass view model and sets up the game state data if any.
Declaration
public static async Task<CompassViewModel> Create(string settingsName, IPhoenixLogger logger, string loggerPrefix, string titleName = null, IDevice device = null, ICompassGameStateClient gameStateClient = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | settingsName | Title Name or specific name for the settings of this compass. |
IPhoenixLogger | logger | The logger. |
System.String | loggerPrefix | The prefix to use when logging so the output can be seen in the same location/color as it's parent's log messages. |
System.String | titleName | The title name if there is one. |
IDevice | device | The device information. |
ICompassGameStateClient | gameStateClient | The compass game state client if one exists. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<CompassViewModel> | The created Compass View Model. |
Dispose()
Declaration
public void Dispose()
ExtractAndAddObjectTypes(List<CompassGameObject>, String, String, Boolean)
Creates a list of object types based on a list of compass game objects and adds it to the Additional Object Types list.
Declaration
public void ExtractAndAddObjectTypes(List<CompassGameObject> cgoList, string dictionaryKey, string compassSourceName, bool enableTypesInCompassByDefault = true)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<CompassGameObject> | cgoList | A list of compass game objects. |
System.String | dictionaryKey | The key to use for adding list of types to a dictionary. |
System.String | compassSourceName | Name of the source this data is coming from to keep types unique. (Ex. Recommendation Name). |
System.Boolean | enableTypesInCompassByDefault | When type is first added to the list set whether it is enabled (shown on compass) to start. |
InitializeCompassObjectViewModelSet(String)
Initializes a new entry into the dictionary of compass view models.
Declaration
public void InitializeCompassObjectViewModelSet(string keyToAdd)
Parameters
Type | Name | Description |
---|---|---|
System.String | keyToAdd | Key to use for adding a new entry in to the dictionary. |
NotifyChangesAndSaveSettings()
If a setting has changed when settings were applied, update objects and save settings.
Declaration
public void NotifyChangesAndSaveSettings()
RefreshCompass()
Refreshes the compass's object types and objects.
Declaration
public async void RefreshCompass()
RemoveCompassObjectViewModelSet(String)
Removes a set based on the given key.
Declaration
public void RemoveCompassObjectViewModelSet(string keyToRemove)
Parameters
Type | Name | Description |
---|---|---|
System.String | keyToRemove | The key of the set to remove. |
RemoveCompassObjectViewModelSets(List<CompassObjectType>)
Removes sets that were added via game state data based on keys of the title name and the game state type.
Declaration
public void RemoveCompassObjectViewModelSets(List<CompassObjectType> typesToRemove)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<CompassObjectType> | typesToRemove | List of types of objects to be removed. |
RemoveCompassObjectViewModelSets(List<String>)
Removes sets based on the given list of keys to remove.
Declaration
public void RemoveCompassObjectViewModelSets(List<string> keysToRemove)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.String> | keysToRemove | Keys to represent which sets should be removed. |
Shutdown()
Ensures any compass threads/tasks are cancelled.
Declaration
public void Shutdown()
UpdateAvailableObjectTypes()
Updates the collection of available objects by combining game state types and additional object types (Ex. from recommendations).
Declaration
public async Task UpdateAvailableObjectTypes()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
UpdatePlayerGameObject(PlayerGameObject)
Updates the player data if not using player data from GST.
Declaration
public void UpdatePlayerGameObject(PlayerGameObject playerGameObject)
Parameters
Type | Name | Description |
---|---|---|
PlayerGameObject | playerGameObject | The updated player object. |