public override float RatioOfBoysFromTotal(User i_LoggedInUser, LogicApp i_logicApp) { int counterBoys = 0; int counterGirls = 0; String userGender = UsefulMethods.getGender(i_LoggedInUser); foreach (User friend in i_logicApp.getListOfFriends()) { String friendGender = UsefulMethods.getGender(friend); if (friendGender == "female") { counterGirls += 1; } else { counterBoys += 1; } } float result = counterBoys / i_LoggedInUser.Friends.Count; return(result); }
public override float RatioOfBoysFromTotal(User i_LoggedInUser, LogicApp i_logicApp) { int counterBoys = 0; int counterGirls = 0; String userGender = UsefulMethods.getGender(i_LoggedInUser); foreach (User friend in i_logicApp.getListOfFriends()) { String m_friendGender = UsefulMethods.getGender(friend); String m_UserRelationshipStatus = UsefulMethods.getRelationshipStatus(friend); if (m_friendGender == "female" && !(m_UserRelationshipStatus.Equals("Married") || m_UserRelationshipStatus.Equals("In a relationship"))) { counterGirls += 1; } else { counterBoys += 1; } } float result = counterBoys / i_LoggedInUser.Friends.Count; return(result); }
public static LogicApp getLogicApp() { if (!s_Created) { s_LogicApp = new LogicApp(); } return(s_LogicApp); }
private LogicApp() { s_LogicApp = this; s_Created = true; }
public abstract float RatioOfBoysFromTotal(User i_LoggedInUser, LogicApp i_logicApp);