Skip to content

Commit

Permalink
Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
Milkitic committed Dec 24, 2023
1 parent 246697b commit 22987ba
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 23 deletions.
1 change: 1 addition & 0 deletions KeyAsio.MemoryReading/Mods.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace KeyAsio.MemoryReading;

[Flags]
public enum Mods : uint
{
Expand Down
3 changes: 3 additions & 0 deletions KeyAsio.Shared/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("ColumnTest")]
8 changes: 3 additions & 5 deletions KeyAsio.Shared/Realtime/RealtimeModeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace KeyAsio.Shared.Realtime;

public class RealtimeModeManager : ViewModelBase
{
private static readonly string[] SkinAudioFiles = { "combobreak" };
private static readonly string[] SkinAudioFiles = ["combobreak"];

public static RealtimeModeManager Instance { get; } = new();
private static readonly ILogger Logger = LogUtils.GetLogger(nameof(RealtimeModeManager));
Expand Down Expand Up @@ -183,7 +183,7 @@ public OsuMemoryStatus OsuStatus
}
}

public OsuFile? OsuFile { get; /*private*/ set; }
public OsuFile? OsuFile { get; internal set; }

public string? AudioFilename { get; set; }

Expand All @@ -205,8 +205,6 @@ public bool IsStarted
set { lock (_isStartedLock) { SetField(ref _isStarted, value); } }
}

//public OsuListenerManager? OsuListenerManager { get; set; }

public AppSettings AppSettings => ConfigurationFactory.GetConfiguration<AppSettings>();

public IReadOnlyList<HitsoundNode> PlaybackList => _playbackList;
Expand Down Expand Up @@ -667,7 +665,7 @@ private void OnBeatmapChanged(BeatmapIdentifier beatmap)
if (OsuStatus is OsuMemoryStatus.SongSelect or OsuMemoryStatus.SongSelectEdit or
OsuMemoryStatus.MainMenu && beatmap != default)
{
var coosu = OsuFile.ReadFromFile(Beatmap.FilenameFull, k =>
var coosu = OsuFile.ReadFromFile(beatmap.FilenameFull, k =>
{
k.IncludeSection("General");
k.IncludeSection("Metadata");
Expand Down
6 changes: 2 additions & 4 deletions KeyAsio.Shared/Realtime/SkinManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ private SkinManager()

public SharedViewModel SharedViewModel => SharedViewModel.Instance;
public AppSettings AppSettings => ConfigurationFactory.GetConfiguration<AppSettings>();
//public OsuListenerManager? OsuListenerManager => RealtimeModeManager.Instance.OsuListenerManager;

public void ListenPropertyChanging()
{
Expand All @@ -48,9 +47,8 @@ public void ListenPropertyChanging()

public void ListenToProcess()
{
var manager = MemoryScan.MemoryReadObject;
if (manager == null) return;
manager.OsuStatusChanged += (pre, current) =>
var memoryReadObject = MemoryScan.MemoryReadObject;
memoryReadObject.OsuStatusChanged += (pre, current) =>
{
if (current is OsuMemoryStatus.NotRunning or OsuMemoryStatus.Unknown)
{
Expand Down
15 changes: 1 addition & 14 deletions Tests/MemoryReadingTest/Charts/PlayTimeChart.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Collections.ObjectModel;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using KeyAsio.MemoryReading;
using KeyAsio.Shared.Models;
using LiveChartsCore;
Expand Down

0 comments on commit 22987ba

Please sign in to comment.