diff options
| author | Alex Barney <thealexbarney@gmail.com> | 2018-12-04 14:23:37 -0600 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-12-04 18:23:37 -0200 |
| commit | 85dbb9559ad317a657dafd24da27fec4b3f5250f (patch) | |
| tree | ecd92931bc2146e549484d9a3af308469089ad4e /Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs | |
| parent | c86aacde76b5f8e503e2b412385c8491ecc86b3b (diff) | |
Adjust naming conventions and general refactoring in HLE Project (#490)
* Rename enum fields
* Naming conventions
* Remove unneeded ".this"
* Remove unneeded semicolons
* Remove unused Usings
* Don't use var
* Remove unneeded enum underlying types
* Explicitly label class visibility
* Remove unneeded @ prefixes
* Remove unneeded commas
* Remove unneeded if expressions
* Method doesn't use unsafe code
* Remove unneeded casts
* Initialized objects don't need an empty constructor
* Remove settings from DotSettings
* Revert "Explicitly label class visibility"
This reverts commit ad5eb5787cc5b27a4631cd46ef5f551c4ae95e51.
* Small changes
* Revert external enum renaming
* Changes from feedback
* Remove unneeded property setters
Diffstat (limited to 'Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs')
| -rw-r--r-- | Ryujinx.HLE/HOS/SystemState/SystemStateMgr.cs | 60 |
1 files changed, 30 insertions, 30 deletions
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; } } } |
