diff options
Diffstat (limited to 'Ryujinx.HLE/HOS/SystemState')
| -rw-r--r-- | Ryujinx.HLE/HOS/SystemState/AppletStateMgr.cs | 24 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs | 60 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/SystemState/UserProfile.cs | 10 |
3 files changed, 47 insertions, 47 deletions
diff --git a/Ryujinx.HLE/HOS/SystemState/AppletStateMgr.cs b/Ryujinx.HLE/HOS/SystemState/AppletStateMgr.cs index 274892c0..3a4fa3c5 100644 --- a/Ryujinx.HLE/HOS/SystemState/AppletStateMgr.cs +++ b/Ryujinx.HLE/HOS/SystemState/AppletStateMgr.cs @@ -6,43 +6,43 @@ namespace Ryujinx.HLE.HOS.SystemState { class AppletStateMgr { - private ConcurrentQueue<MessageInfo> Messages; + private ConcurrentQueue<MessageInfo> _messages; public FocusState FocusState { get; private set; } - public KEvent MessageEvent { get; private set; } + public KEvent MessageEvent { get; } - public AppletStateMgr(Horizon System) + public AppletStateMgr(Horizon system) { - Messages = new ConcurrentQueue<MessageInfo>(); + _messages = new ConcurrentQueue<MessageInfo>(); - MessageEvent = new KEvent(System); + MessageEvent = new KEvent(system); } - public void SetFocus(bool IsFocused) + public void SetFocus(bool isFocused) { - FocusState = IsFocused + FocusState = isFocused ? FocusState.InFocus : FocusState.OutOfFocus; EnqueueMessage(MessageInfo.FocusStateChanged); } - public void EnqueueMessage(MessageInfo Message) + public void EnqueueMessage(MessageInfo message) { - Messages.Enqueue(Message); + _messages.Enqueue(message); MessageEvent.ReadableEvent.Signal(); } - public bool TryDequeueMessage(out MessageInfo Message) + public bool TryDequeueMessage(out MessageInfo message) { - if (Messages.Count < 2) + if (_messages.Count < 2) { MessageEvent.ReadableEvent.Clear(); } - return Messages.TryDequeue(out Message); + return _messages.TryDequeue(out message); } } }
\ No newline at end of file diff --git a/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs b/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs index aa96a416..74513795 100644 --- a/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs +++ b/Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs @@ -48,7 +48,7 @@ namespace Ryujinx.HLE.HOS.SystemState public bool InstallContents { get; set; } - private ConcurrentDictionary<string, UserProfile> Profiles; + private ConcurrentDictionary<string, UserProfile> _profiles; internal UserProfile LastOpenUser { get; private set; } @@ -58,20 +58,20 @@ namespace Ryujinx.HLE.HOS.SystemState SetAudioOutputAsBuiltInSpeaker(); - Profiles = new ConcurrentDictionary<string, UserProfile>(); + _profiles = new ConcurrentDictionary<string, UserProfile>(); - UInt128 DefaultUuid = new UInt128("00000000000000000000000000000001"); + UInt128 defaultUuid = new UInt128("00000000000000000000000000000001"); - AddUser(DefaultUuid, "Player"); + AddUser(defaultUuid, "Player"); - OpenUser(DefaultUuid); + OpenUser(defaultUuid); } - public void SetLanguage(SystemLanguage Language) + public void SetLanguage(SystemLanguage language) { - DesiredLanguageCode = GetLanguageCode((int)Language); + DesiredLanguageCode = GetLanguageCode((int)language); - DesiredTitleLanguage = Enum.Parse<TitleLanguage>(Enum.GetName(typeof(SystemLanguage), Language)); + DesiredTitleLanguage = Enum.Parse<TitleLanguage>(Enum.GetName(typeof(SystemLanguage), language)); } public void SetAudioOutputAsTv() @@ -89,65 +89,65 @@ namespace Ryujinx.HLE.HOS.SystemState ActiveAudioOutput = AudioOutputs[2]; } - public void AddUser(UInt128 Uuid, string Name) + public void AddUser(UInt128 uuid, string name) { - UserProfile Profile = new UserProfile(Uuid, Name); + UserProfile profile = new UserProfile(uuid, name); - Profiles.AddOrUpdate(Uuid.ToString(), Profile, (Key, Old) => Profile); + _profiles.AddOrUpdate(uuid.ToString(), profile, (key, old) => profile); } - public void OpenUser(UInt128 Uuid) + public void OpenUser(UInt128 uuid) { - if (Profiles.TryGetValue(Uuid.ToString(), out UserProfile Profile)) + if (_profiles.TryGetValue(uuid.ToString(), out UserProfile profile)) { - (LastOpenUser = Profile).AccountState = OpenCloseState.Open; + (LastOpenUser = profile).AccountState = OpenCloseState.Open; } } - public void CloseUser(UInt128 Uuid) + public void CloseUser(UInt128 uuid) { - if (Profiles.TryGetValue(Uuid.ToString(), out UserProfile Profile)) + if (_profiles.TryGetValue(uuid.ToString(), out UserProfile profile)) { - Profile.AccountState = OpenCloseState.Closed; + profile.AccountState = OpenCloseState.Closed; } } public int GetUserCount() { - return Profiles.Count; + return _profiles.Count; } - internal bool TryGetUser(UInt128 Uuid, out UserProfile Profile) + internal bool TryGetUser(UInt128 uuid, out UserProfile profile) { - return Profiles.TryGetValue(Uuid.ToString(), out Profile); + return _profiles.TryGetValue(uuid.ToString(), out profile); } internal IEnumerable<UserProfile> GetAllUsers() { - return Profiles.Values; + return _profiles.Values; } internal IEnumerable<UserProfile> GetOpenUsers() { - return Profiles.Values.Where(x => x.AccountState == OpenCloseState.Open); + return _profiles.Values.Where(x => x.AccountState == OpenCloseState.Open); } - internal static long GetLanguageCode(int Index) + internal static long GetLanguageCode(int index) { - if ((uint)Index >= LanguageCodes.Length) + if ((uint)index >= LanguageCodes.Length) { - throw new ArgumentOutOfRangeException(nameof(Index)); + throw new ArgumentOutOfRangeException(nameof(index)); } - long Code = 0; - int Shift = 0; + long code = 0; + int shift = 0; - foreach (char Chr in LanguageCodes[Index]) + foreach (char chr in LanguageCodes[index]) { - Code |= (long)(byte)Chr << Shift++ * 8; + code |= (long)(byte)chr << shift++ * 8; } - return Code; + return code; } } } diff --git a/Ryujinx.HLE/HOS/SystemState/UserProfile.cs b/Ryujinx.HLE/HOS/SystemState/UserProfile.cs index e08bc48a..cbf6034d 100644 --- a/Ryujinx.HLE/HOS/SystemState/UserProfile.cs +++ b/Ryujinx.HLE/HOS/SystemState/UserProfile.cs @@ -7,19 +7,19 @@ namespace Ryujinx.HLE.HOS.SystemState { private static readonly DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); - public UInt128 Uuid { get; private set; } + public UInt128 Uuid { get; } - public string Name { get; private set; } + public string Name { get; } public long LastModifiedTimestamp { get; private set; } public OpenCloseState AccountState { get; set; } public OpenCloseState OnlinePlayState { get; set; } - public UserProfile(UInt128 Uuid, string Name) + public UserProfile(UInt128 uuid, string name) { - this.Uuid = Uuid; - this.Name = Name; + Uuid = uuid; + Name = name; LastModifiedTimestamp = 0; |
