Resolve WES-56 "Account switching"

This commit is contained in:
Dries Van Schuylenbergh
2023-03-12 19:36:37 +00:00
committed by Jelle De Geest
parent 0ea743354b
commit b6b863183e
19 changed files with 5595 additions and 256 deletions

View File

@@ -20,6 +20,7 @@ public class UserList : ScriptableObject
/// The index of the current/last logged in user in the <c>storedUsers</c> list
/// </summary>
public int currentUserIndex;
/// <summary>
/// A list containing all users (which can be serialized)
/// </summary>
@@ -105,6 +106,33 @@ public class UserList : ScriptableObject
return storedUserList.storedUsers[storedUserList.currentUserIndex];
}
/// <summary>
/// Get the index in the userlist of the current playing user
/// </summary>
/// <returns></returns>
public int GetCurrentUserIndex()
{
return storedUserList.currentUserIndex;
}
/// <summary>
/// Change the current user
/// </summary>
/// <param name="index">Index of the user in the userlist</param>
public void ChangeCurrentUser(int index)
{
storedUserList.currentUserIndex = index;
}
/// <summary>
/// Change the current user
/// </summary>
/// <param name="user">Reference to the user in the userlist</param>
public void ChangeCurrentUser(User user)
{
storedUserList.currentUserIndex = storedUserList.storedUsers.IndexOf(user);
}
/// <summary>
/// Save the users
/// </summary>