Resolve WES-95 "User progress"

This commit is contained in:
Dries Van Schuylenbergh
2023-03-18 10:25:49 +00:00
parent 5e26970bad
commit 9dfadece44
39 changed files with 4208 additions and 69 deletions

View File

@@ -133,6 +133,35 @@ public class UserList : ScriptableObject
storedUserList.currentUserIndex = storedUserList.storedUsers.IndexOf(user);
}
/// <summary>
/// Remove the user
/// </summary>
/// <param name="index">The index of the user in the userlist</param>
/// <returns>true if user was successful removed, false otherwise</returns>
public bool DeleteUser(int index)
{
return DeleteUser(storedUserList.storedUsers[index]);
}
/// <summary>
/// I am inevitable, *snap*
/// </summary>
/// <param name="user">Reference to the user to be removed</param>
/// <returns>true if the user was successful removed, false otherwise</returns>
public bool DeleteUser(User user)
{
if (1 < storedUserList.storedUsers.Count)
{
if (storedUserList.currentUserIndex == storedUserList.storedUsers.Count - 1)
{
storedUserList.currentUserIndex--;
}
return storedUserList.storedUsers.Remove(user);
}
return false;
}
/// <summary>
/// Save the users
/// </summary>