-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
150 additions
and
35 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
src/Artemis.Plugins.Games.Osu/DataModels/BeatmapDataModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using Artemis.Core.Modules; | ||
using OsuMemoryDataProvider.OsuMemoryModels.Direct; | ||
|
||
namespace Artemis.Plugins.Games.Osu.DataModels; | ||
|
||
public class BeatmapDataModel : DataModel | ||
{ | ||
public int Id { get; set; } | ||
|
||
public int SetId { get; set; } | ||
|
||
public string MapString { get; set; } | ||
|
||
public string FolderName { get; set; } | ||
|
||
public string OsuFileName { get; set; } | ||
|
||
public string Md5 { get; set; } | ||
|
||
public float Ar { get; set; } | ||
|
||
public float Cs { get; set; } | ||
|
||
public float Hp { get; set; } | ||
|
||
public float Od { get; set; } | ||
|
||
public short Status { get; set; } | ||
|
||
public void Apply(CurrentBeatmap beatmap) | ||
{ | ||
Id = beatmap.Id; | ||
SetId = beatmap.SetId; | ||
MapString = beatmap.MapString; | ||
FolderName = beatmap.FolderName; | ||
OsuFileName = beatmap.OsuFileName; | ||
Md5 = beatmap.Md5; | ||
Ar = beatmap.Ar; | ||
Cs = beatmap.Cs; | ||
Hp = beatmap.Hp; | ||
Od = beatmap.Od; | ||
Status = beatmap.Status; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
src/Artemis.Plugins.Games.Osu/DataModels/GeneralDataModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Artemis.Core.Modules; | ||
using OsuMemoryDataProvider.OsuMemoryModels.Direct; | ||
|
||
namespace Artemis.Plugins.Games.Osu.DataModels; | ||
|
||
public class GeneralDataModel : DataModel | ||
{ | ||
public int RawStatus { get; set; } | ||
|
||
public OsuStatus Status => (OsuStatus) RawStatus; | ||
|
||
public int GameMode { get; set; } | ||
|
||
public int Retries { get; set; } | ||
|
||
public int AudioTime { get; set; } | ||
|
||
public double TotalAudioTime { get; set; } | ||
|
||
public bool ChatIsExpanded { get; set; } | ||
|
||
public int Mods { get; set; } | ||
|
||
public bool ShowPlayingInterface { get; set; } | ||
|
||
public string OsuVersion { get; set; } | ||
|
||
public void Apply(GeneralData generalData) | ||
{ | ||
RawStatus = generalData.RawStatus; | ||
GameMode = generalData.GameMode; | ||
Retries = generalData.Retries; | ||
AudioTime = generalData.AudioTime; | ||
TotalAudioTime = generalData.TotalAudioTime; | ||
ChatIsExpanded = generalData.ChatIsExpanded; | ||
Mods = generalData.Mods; | ||
ShowPlayingInterface = generalData.ShowPlayingInterface; | ||
OsuVersion = generalData.OsuVersion; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,10 @@ | ||
using Artemis.Core.Modules; | ||
using OsuMemoryDataProvider.OsuMemoryModels.Direct; | ||
|
||
namespace Artemis.Plugins.Games.Osu.DataModels; | ||
|
||
public class OsuDataModel : DataModel | ||
{ | ||
public GeneralDataModel GeneralData { get; set; } = new(); | ||
} | ||
|
||
public class GeneralDataModel : DataModel | ||
{ | ||
public int RawStatus { get; set; } | ||
|
||
public int GameMode { get; set; } | ||
|
||
public int Retries { get; set; } | ||
|
||
public int AudioTime { get; set; } | ||
|
||
public double TotalAudioTime { get; set; } | ||
|
||
public bool ChatIsExpanded { get; set; } | ||
|
||
public int Mods { get; set; } | ||
|
||
public bool ShowPlayingInterface { get; set; } | ||
|
||
public string OsuVersion { get; set; } | ||
|
||
public void Apply(GeneralData generalData) | ||
{ | ||
RawStatus = generalData.RawStatus; | ||
GameMode = generalData.GameMode; | ||
Retries = generalData.Retries; | ||
AudioTime = generalData.AudioTime; | ||
TotalAudioTime = generalData.TotalAudioTime; | ||
ChatIsExpanded = generalData.ChatIsExpanded; | ||
Mods = generalData.Mods; | ||
ShowPlayingInterface = generalData.ShowPlayingInterface; | ||
OsuVersion = generalData.OsuVersion; | ||
} | ||
public PlayerDataModel Player { get; set; } = new(); | ||
public BeatmapDataModel Beatmap { get; set; } = new(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace Artemis.Plugins.Games.Osu.DataModels; | ||
|
||
public enum OsuStatus | ||
{ | ||
Unknown = -2, // 0xFFFFFFFE | ||
NotRunning = -1, // 0xFFFFFFFF | ||
MainMenu = 0, | ||
EditingMap = 1, | ||
Playing = 2, | ||
GameShutdownAnimation = 3, | ||
SongSelectEdit = 4, | ||
SongSelect = 5, | ||
WIP_NoIdeaWhatThisIs = 6, | ||
ResultsScreen = 7, | ||
GameStartupAnimation = 10, // 0x0000000A | ||
MultiplayerRooms = 11, // 0x0000000B | ||
MultiplayerRoom = 12, // 0x0000000C | ||
MultiplayerSongSelect = 13, // 0x0000000D | ||
MultiplayerResultsscreen = 14, // 0x0000000E | ||
OsuDirect = 15, // 0x0000000F | ||
RankingTagCoop = 17, // 0x00000011 | ||
RankingTeam = 18, // 0x00000012 | ||
ProcessingBeatmaps = 19, // 0x00000013 | ||
Tourney = 22, // 0x00000016 | ||
} |
28 changes: 28 additions & 0 deletions
28
src/Artemis.Plugins.Games.Osu/DataModels/PlayerDataModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Artemis.Core.Modules; | ||
using OsuMemoryDataProvider.OsuMemoryModels.Direct; | ||
|
||
namespace Artemis.Plugins.Games.Osu.DataModels; | ||
|
||
public class PlayerDataModel : DataModel | ||
{ | ||
public double HPSmooth { get; set; } | ||
|
||
public double HP { get; set; } | ||
|
||
public double Accuracy { get; set; } | ||
|
||
public List<int> HitErrors { get; set; } | ||
|
||
public bool IsReplay { get; set; } | ||
|
||
public void Apply(Player player) | ||
{ | ||
HPSmooth = player.HPSmooth; | ||
HP = player.HP; | ||
Accuracy = player.Accuracy; | ||
HitErrors = player.HitErrors.ToList(); | ||
IsReplay = player.IsReplay; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters