public bool TryAdd(UserState user) { if ((user == null) || (string.IsNullOrEmpty(user.Login))) { return(false); } if (_file.State.Users.ContainsKey(user.Login)) { return(false); } _file.State.Users.Add(user.Login, user); _file.Save(); return(true); }
public GameState Save(UserState user, GameState state) { _file.State.States[user.Login] = state; _file.Save(); return(state); }