/// <summary> /// Divorce's a specified user /// </summary> /// <param name="contextUser"></param> /// <param name="proposedUser"></param> public static void DivorceUser(SocketUser contextUser, SocketUser proposedUser) { var userPf = UserProfiles.GetAccount(contextUser); // You var proposedUserPf = UserProfiles.GetAccount(proposedUser); // Proposer proposedUserPf.Marriages.Remove(userPf.ID); userPf.Marriages.Remove(proposedUserPf.ID); SaveProfiles(); }
public static void RemoveMarriageProposal(SocketUser contextUser, SocketUser proposedUser) { var userPf = UserProfiles.GetAccount(contextUser); var proposedUserPf = UserProfiles.GetAccount(proposedUser); proposedUserPf.MarriageProposals.Remove(userPf.ID); userPf.SentMarriageProposals.Remove(proposedUserPf.ID); SaveProfiles(); }
/// <summary> /// Accept the marriage between two users and marry them /// </summary> /// <param name="contextUser"></param> /// <param name="proposedUser"></param> public static void AcceptMarriage(SocketUser contextUser, SocketUser proposedUser) { var userPf = UserProfiles.GetAccount(contextUser); // You var proposedUserPf = UserProfiles.GetAccount(proposedUser); // Proposer userPf.Marriages.Add(proposedUserPf.ID); proposedUserPf.Marriages.Add(userPf.ID); RemoveMarriageProposal(contextUser, proposedUser); SaveProfiles(); }
/// <summary> /// Gets and returns all the marriages from the current user into a string /// </summary> /// <param name="user"></param> /// <returns></returns> private static String GetUserMarriages(SocketUser user) { var profile = UserProfiles.GetAccount(user); List <string> marriages = new List <string>(); // If the marriages is not empty or null add them to the marriages List and return // a formatted string of the married users, otherwise return a string of 'no marriages' if (profile.Marriages.Count != 0) { foreach (var item in profile.Marriages) { var marriedUser = GetAccount(item); marriages.Add(marriedUser.Username); } return(string.Join("\n", marriages)); } else { return("No Marriages"); } }
/// <summary> /// Returns the user's currency amount /// </summary> /// <param name="user"></param> /// <returns></returns> public static uint GetCurrency(SocketUser user) { var profile = UserProfiles.GetAccount(user); return(profile.Points); }
/// <summary> /// Returns the user's ID /// </summary> /// <param name="user"></param> /// <returns></returns> public static ulong GetId(SocketUser user) { var profile = UserProfiles.GetAccount(user); return(profile.ID); }
/// <summary> /// Returns the user's current level /// </summary> /// <param name="user"></param> /// <returns></returns> public static uint GetLevel(SocketUser user) { var profile = UserProfiles.GetAccount(user); return(profile.LevelNumber); }