DiscoverTenerife
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
FriendData Class Reference

Class that stores the information of one of the current user's friend. More...

Public Member Functions

 FriendData (string uid, string displayName, List< string > deletedFriends, List< Dictionary< string, string > > challengeData, List< string > acceptedFriends, int score)
 Constructor that initialize the uid_, the displayName_, the deletedFriends_ and challenges_ properties with the given parameters. More...
 
string getUid ()
 getter of the user id. More...
 
string getDisplayName ()
 getter of the user id. More...
 
int getScore ()
 getter of the score_ property More...
 
void addDeletedFriend (string uid)
 this method add the given user id to the deletedFriends_ property list. More...
 
string getStringConversionOfDeletedFriends ()
 this method convers the deletedFriends_ property into a string with the JSON format and returns the conversion. More...
 
void createNewChallenge (string placeId, string placeType, string challengerId)
 this method instanciate a new challengeData object with the given information and the current ticks and it adds the new challengeData object to the challenges_ property. More...
 
bool hasAChallengeOfThisUser (string uid)
 This method returns true if the represented user has a challenge of the user that has the given user id, in other case, it returns false. More...
 
string getStringConversionOfChallenges ()
 This method returns a string conversion of the whole list of challenges of the represented user. It uses the ToJson method of the challengeData class. More...
 
void addANewAcceptedFriend (string uid)
 This method adds the given user id to the list of friendships invitations accepted if the given user id isnt on the acceptedFriendsInvitations_ property list. More...
 
string getStringConversionOfNewAcceptedFriends ()
 This method returns a string that contains the conversion of the acceptedFriendsInvitations_ list property in JSON format. More...
 
string getJSONof (string property)
 This method calls the correspondent method of getStringConversionOf* Si se le da un nombre erroneo retornara un string vacio. More...
 
challengeData getChallengeOfUser (string uid)
 This method returns the challenge information of the challenge that has as a challenger the user with the given uid. If there isnt any challenge with that user id it returns null. More...
 

Static Public Attributes

static List< string > usersThatAllowFriendshipInvitations_
 List of strings that contains the user id of the users that allow receive friendships invitations from other players. More...
 
static List< string > usersThatAllowBeChallenged_
 List of strings that contains the user id of the users that allow receive challenges from other players that are they friends. More...
 
static List< string > usersThatAllowAppearedOnRanking_
 List of strings that contains the user id of the users that allow be shown on the ranking of the players. More...
 
static FriendData chosenFriend_
 static property that stored the information of the chosen friend. More...
 

Private Attributes

string uid_
 string that contains the user id of the represented user. More...
 
string displayName_
 string that contains the display name of the represented user. More...
 
string rank_
 string that contains the current rank of the represented user. More...
 
int score_
 int that contains the current score of the represented user. More...
 
List< string > deletedFriends_
 List that contains strings with the user id of the users that has removed their frienship with the represented user. It has to be a list because more than one user can erase their friendship before the represented user connects again to the app. More...
 
List< challengeDatachallenges_
 List that contains challengeData objects that represents all the challenges that the represented friend has. More...
 
List< string > acceptedFriendsInvitations_
 List that contains the invitations that this user sended and the other player accepted de invitation. More...
 

Detailed Description

Class that stores the information of one of the current user's friend.

Constructor & Destructor Documentation

◆ FriendData()

FriendData.FriendData ( string  uid,
string  displayName,
List< string >  deletedFriends,
List< Dictionary< string, string > >  challengeData,
List< string >  acceptedFriends,
int  score 
)

Constructor that initialize the uid_, the displayName_, the deletedFriends_ and challenges_ properties with the given parameters.

Parameters
stringuser id of the represented user.
stringdisplay name of the represented user.
List<string>list of strings that contains the user ids from the users that have deleted the friendship.
List<Dictionary<string,string>>list that contains all the information on dictionaries of strings of all the challenges that represented friend has.

Member Function Documentation

◆ addANewAcceptedFriend()

void FriendData.addANewAcceptedFriend ( string  uid)

This method adds the given user id to the list of friendships invitations accepted if the given user id isnt on the acceptedFriendsInvitations_ property list.

Parameters
stringwith the user id of the user that has accepted the friendship invitation that this user has sended.

◆ addDeletedFriend()

void FriendData.addDeletedFriend ( string  uid)

this method add the given user id to the deletedFriends_ property list.

Parameters
stringwith the user id of the user that has deleted the friendship.

◆ createNewChallenge()

void FriendData.createNewChallenge ( string  placeId,
string  placeType,
string  challengerId 
)

this method instanciate a new challengeData object with the given information and the current ticks and it adds the new challengeData object to the challenges_ property.

Parameters
stringthat contains the place id of the place that the user has to visit for completing the challenge.
stringthat contains the type of the place that the user has to visit for completing the challenge.
stringthat contains the user id of the user that has challenged the represented user.

◆ getChallengeOfUser()

challengeData FriendData.getChallengeOfUser ( string  uid)

This method returns the challenge information of the challenge that has as a challenger the user with the given uid. If there isnt any challenge with that user id it returns null.

Parameters
stringwith the user id
Returns
challengeData with the information of the searched challenge

◆ getDisplayName()

string FriendData.getDisplayName ( )

getter of the user id.

Returns
string with the display name of the represented user.

◆ getJSONof()

string FriendData.getJSONof ( string  property)

This method calls the correspondent method of getStringConversionOf* Si se le da un nombre erroneo retornara un string vacio.

Parameters
stringwith the name of the property that you want to obtain the json conversion
Returns
string witht the json conversion of the value of the given propertie

◆ getScore()

int FriendData.getScore ( )

getter of the score_ property

Returns
int with the friend's score

◆ getStringConversionOfChallenges()

string FriendData.getStringConversionOfChallenges ( )

This method returns a string conversion of the whole list of challenges of the represented user. It uses the ToJson method of the challengeData class.

Returns
string that contains the JSON conversion in a string.

◆ getStringConversionOfDeletedFriends()

string FriendData.getStringConversionOfDeletedFriends ( )

this method convers the deletedFriends_ property into a string with the JSON format and returns the conversion.

Returns
string with a string conversion of the deletedFriends_ list on JSON format.

◆ getStringConversionOfNewAcceptedFriends()

string FriendData.getStringConversionOfNewAcceptedFriends ( )

This method returns a string that contains the conversion of the acceptedFriendsInvitations_ list property in JSON format.

Returns
string with the conversion of acceptedFriendsInvitations_ list property in JSON format.

◆ getUid()

string FriendData.getUid ( )

getter of the user id.

Returns
string with the user id of the represented user.

◆ hasAChallengeOfThisUser()

bool FriendData.hasAChallengeOfThisUser ( string  uid)

This method returns true if the represented user has a challenge of the user that has the given user id, in other case, it returns false.

Parameters
stringthat contains the user id of the user that we are going to check.
Returns
bool, true if the represented user has a challenge of the given user id.

Member Data Documentation

◆ acceptedFriendsInvitations_

List<string> FriendData.acceptedFriendsInvitations_
private

List that contains the invitations that this user sended and the other player accepted de invitation.

◆ challenges_

List<challengeData> FriendData.challenges_
private

List that contains challengeData objects that represents all the challenges that the represented friend has.

◆ chosenFriend_

FriendData FriendData.chosenFriend_
static

static property that stored the information of the chosen friend.

◆ deletedFriends_

List<string> FriendData.deletedFriends_
private

List that contains strings with the user id of the users that has removed their frienship with the represented user. It has to be a list because more than one user can erase their friendship before the represented user connects again to the app.

◆ displayName_

string FriendData.displayName_
private

string that contains the display name of the represented user.

◆ rank_

string FriendData.rank_
private

string that contains the current rank of the represented user.

◆ score_

int FriendData.score_
private

int that contains the current score of the represented user.

◆ uid_

string FriendData.uid_
private

string that contains the user id of the represented user.

◆ usersThatAllowAppearedOnRanking_

List<string> FriendData.usersThatAllowAppearedOnRanking_
static

List of strings that contains the user id of the users that allow be shown on the ranking of the players.

◆ usersThatAllowBeChallenged_

List<string> FriendData.usersThatAllowBeChallenged_
static

List of strings that contains the user id of the users that allow receive challenges from other players that are they friends.

◆ usersThatAllowFriendshipInvitations_

List<string> FriendData.usersThatAllowFriendshipInvitations_
static

List of strings that contains the user id of the users that allow receive friendships invitations from other players.


The documentation for this class was generated from the following file: