Implementing OSRS hiscore lookup page using official hiscores.

This commit is contained in:
2025-06-19 14:53:49 -04:00
parent 847a93b841
commit 4f4339637c
2 changed files with 90 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace osrs_toolbox
{
public abstract class HiscoreLookupModel : ModelBase
{
private string _playerName;
private string _displayOption;
private string[] _displayOptions;
private string _displayOutput;
private ICommand _lookupPlayer;
private PlayerInfo _hiscoreInfo;
public string PlayerName
{
get { return _playerName; }
set { SetProperty(ref _playerName, value, nameof(PlayerName)); }
}
public string DisplayOption
{
get { return _displayOption; }
set { SetProperty(ref _displayOption, value, nameof(DisplayOption)); }
}
public string[] DisplayOptions
{
get { return _displayOptions; }
set { SetProperty(ref _displayOptions, value, nameof(DisplayOptions)); }
}
public string DisplayOutput
{
get { return _displayOutput; }
set { SetProperty(ref _displayOutput, value, nameof(DisplayOutput)); }
}
public ICommand LookupPlayer
{
get { return _lookupPlayer; }
set { SetProperty(ref _lookupPlayer, value, nameof(LookupPlayer)); }
}
public PlayerInfo HiscoreInfo
{
get { return _hiscoreInfo; }
set { SetProperty(ref _hiscoreInfo, value, nameof(HiscoreInfo)); }
}
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace osrs_toolbox
{
public class HiscoreLookupViewModel : HiscoreLookupModel
{
public HiscoreLookupViewModel()
{
InitializeVariables();
InitializeCommands();
}
private void InitializeVariables()
{
PlayerName = string.Empty;
DisplayOption = "Skills";
DisplayOptions = ["Skills", "Activities", "Bosses"];
DisplayOutput = string.Empty;
HiscoreInfo = new();
}
private void InitializeCommands()
{
LookupPlayer = new RelayCommand(DoPlayerLookup);
}
private async void DoPlayerLookup(object obj)
{
}
}
}