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

Class that controls the panel that shows the information of a searched player. More...

Inheritance diagram for SearchedPlayer:

Public Member Functions

void setSearchedPlayerData (Dictionary< string, string > searchedPlayerData)
 This method sets the searchedPlayerData_ property to the value of the given dictionary. It expects a dictionary with the entries: name, uid, rank (on future). It also sets the text component of the text_ game object as the name entry of the given dictionary. More...
 
void sendInvitation ()
 if the onProcess_ property is true, this method dont do nothing. This is a way to control that there isnt several parallel calls to the send invitation process. If onProcess_ property is false but there isnt internet connection, it make a toast animation showing an error message because you have to have internet connection to complete the send invitation process. And if you have internet connection and the onProcess_ property is false, it sets the onProcess_ property to true and then call the sendFriendshipInvitation method of firebaseHandler class. More...
 
void resultOfTheSending (string result)
 This method should be called by the firebaseHandler instance when it finish the sendFriendshipInvitation method. This method shows a toast showing to the user the result of the sending invitation process, if it makes it right it also calls the clearSearchedFriendsPanel method of the SearchedFriendsPanel class. The defined states for the result are failed, repeated and sended. If the given string has a different state, it will show an error on the console. More...
 
void SetPanel (SearchedFriendsPanel panel)
 setter of the panel_ property. More...
 

Private Member Functions

void Awake ()
 This method is called before the first frame. It sets the onProcess_ property to false. More...
 

Private Attributes

GameObject text_
 GameObject that contains the text that shows the display name of the user. More...
 
GameObject toastMessage_
 GameObject the toast message object that will alert the user with the errors if they happen. More...
 
SearchedFriendsPanel panel_
 Reference to the panel that this object is being showed. More...
 
Dictionary< string, string > searchedPlayerData_
 String conversion of the data of the searched player. More...
 
bool onProcess_
 true if the process of sending an invitation is currently working. False in other case. More...
 

Detailed Description

Class that controls the panel that shows the information of a searched player.

Member Function Documentation

◆ Awake()

void SearchedPlayer.Awake ( )
private

This method is called before the first frame. It sets the onProcess_ property to false.

◆ resultOfTheSending()

void SearchedPlayer.resultOfTheSending ( string  result)

This method should be called by the firebaseHandler instance when it finish the sendFriendshipInvitation method. This method shows a toast showing to the user the result of the sending invitation process, if it makes it right it also calls the clearSearchedFriendsPanel method of the SearchedFriendsPanel class. The defined states for the result are failed, repeated and sended. If the given string has a different state, it will show an error on the console.

Parameters
stringwith the result, the string should be one of the defined states.

◆ sendInvitation()

void SearchedPlayer.sendInvitation ( )

if the onProcess_ property is true, this method dont do nothing. This is a way to control that there isnt several parallel calls to the send invitation process. If onProcess_ property is false but there isnt internet connection, it make a toast animation showing an error message because you have to have internet connection to complete the send invitation process. And if you have internet connection and the onProcess_ property is false, it sets the onProcess_ property to true and then call the sendFriendshipInvitation method of firebaseHandler class.

◆ SetPanel()

void SearchedPlayer.SetPanel ( SearchedFriendsPanel  panel)

setter of the panel_ property.

Parameters
referenceto a SearchedFriendsPanel to copy it on the panel_ property.

◆ setSearchedPlayerData()

void SearchedPlayer.setSearchedPlayerData ( Dictionary< string, string >  searchedPlayerData)

This method sets the searchedPlayerData_ property to the value of the given dictionary. It expects a dictionary with the entries: name, uid, rank (on future). It also sets the text component of the text_ game object as the name entry of the given dictionary.

Parameters
Dictionary<string,string>string conversion of the data of the searched player.

Member Data Documentation

◆ onProcess_

bool SearchedPlayer.onProcess_
private

true if the process of sending an invitation is currently working. False in other case.

◆ panel_

SearchedFriendsPanel SearchedPlayer.panel_
private

Reference to the panel that this object is being showed.

◆ searchedPlayerData_

Dictionary<string,string> SearchedPlayer.searchedPlayerData_
private

String conversion of the data of the searched player.

◆ text_

GameObject SearchedPlayer.text_
private

GameObject that contains the text that shows the display name of the user.

◆ toastMessage_

GameObject SearchedPlayer.toastMessage_
private

GameObject the toast message object that will alert the user with the errors if they happen.


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