예제 #1
0
        /// <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();
        }
예제 #2
0
        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();
        }
예제 #3
0
        /// <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();
        }
예제 #4
0
        /// <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");
            }
        }
예제 #5
0
        /// <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);
        }
예제 #6
0
        /// <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);
        }
예제 #7
0
        /// <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);
        }