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

Controls the options that the user has chosen. It follows the singleton pattern so it only can be one instance of this class per execution. This class isnt destroyed on load. More...

Inheritance diagram for optionsController:

Public Member Functions

bool distanceInKM ()
 getter of the distanceInKM_ property. More...
 
bool sortByLessDistance ()
 getter of the sortByLessDistance_ property. More...
 
Dictionary< string, bool > whatToSeeOptions ()
 return a dictionary that contains an entry for each type of place, each entry has a boolean value that is true if the user chose he wants to see it and false if he dont want to see it. There is an aditional entry for choosing if the user wants to see places that he already had visited. More...
 
void copyOptions ()
 this method make that the gameobjects of the options screen show the same choices that this class has stored on his attributes. More...
 
void copyStoryOptions ()
 this method make that the gameobject of the story options show the same choices that this class has stored on his attributes. More...
 
void saveOptions ()
 this method store on this class attributes the user choices of the options screen and sets the optionsCopied_ property to true. More...
 
bool sortStoryByFirstVisit ()
 getter of the sortStoryByFirstVisit_ attribute. More...
 
bool socialOptions (string option)
 getter of the given social option. More...
 

Static Public Attributes

static optionsController optionsControllerInstance_ = null
 reference to the unique instance of the class that can exist on each execution. More...
 
static GameObject lastOptionClicked_
 reference to the last clicked option on the options screen. More...
 

Private Member Functions

void Awake ()
 this method is called before the first frame, it checks if exits another optionsController instance, on that case destroy this gameobject. It also stores the name of the current scene. More...
 
void Start ()
 this method is called on the first frame. It check if the user has already stored some options on the current device, if that is not the case, it creates the option as activated. If the user has already stored some options it loads the options from the current device. It also intializes all the properties of the object. More...
 
void Update ()
 this method is called each frame. First it checks if the options isnt copied and youre on the options screen or in the story screen and calls the copyOptions or the copyStoryOptions respectively. It also check if youre exiting the options screen or the story screen and if that is the case it calls the storeOptions method. If youre changing scene and youre on the options screen it finds and initialize the sortByLessDistanceMenu_, whatToSeeMenu_, distanceUnitMenu_, socialOptionsMenu_ properties and sets the optionsCopied_ as false. If youre changing scene and youre on the story screen it finds and initialize the sortStoryMenu_ property and sets the optionsCopied_ as false. If youre changing scene and youre neither on the story screen nor the options screen it sets the gameobject of the options as null. More...
 
void storeOptions ()
 This method stores the options choices of the current user on the current device. More...
 

Private Attributes

bool distanceInKM_
 true if the user has chosen to see the distance in Kilometers, false if the user has chosen to see the distance in Milles. More...
 
Dictionary< string, bool > whatToSee_
 This dictionary has an entry for each type of site. The key is the type of the site, and the value is if the user has chosen to see that type of site or not. More...
 
Dictionary< string, bool > socialOptions_
 This dictionary has an entry for each social option, allow that other users can find me on the ranking, allow that other user can send me friendship invitations or allow that my friends can chanllege me. More...
 
bool sortByLessDistance_
 true if the user has chosen that places has to be sorted by less distance first, false if the user has chosen that places has to be sorted by more visited first. More...
 
bool sortStoryByFirstVisit_
 true if the user has chosen that places on the story has to be sorted by first visited first, false if the user has chosen that the places on the story has to be sorted by most recent visited first. More...
 
string lastScene_
 contains the name of the last scene that this object was. More...
 
uniqueselectionDesplegableMenu sortByLessDistanceMenu_
 reference to the game object of the sorting places options. More...
 
multiselectionDesplegableMenu whatToSeeMenu_
 reference to the game object of the what type of places you want to see options. More...
 
multiselectionDesplegableMenu socialOptionsMenu_
 reference to the game object of the social options. More...
 
uniqueselectionDesplegableMenu distanceUnitMenu_
 reference to the game object of the chosing distance unit options. More...
 
uniqueselectionDesplegableMenu sortStoryMenu_
 reference to the game object of the sorting places on the story options. More...
 
bool optionsCopied_
 true if the value of the options were asigned to the game object that represent those options. More...
 

Detailed Description

Controls the options that the user has chosen. It follows the singleton pattern so it only can be one instance of this class per execution. This class isnt destroyed on load.

Member Function Documentation

◆ Awake()

void optionsController.Awake ( )
private

this method is called before the first frame, it checks if exits another optionsController instance, on that case destroy this gameobject. It also stores the name of the current scene.

◆ copyOptions()

void optionsController.copyOptions ( )

this method make that the gameobjects of the options screen show the same choices that this class has stored on his attributes.

◆ copyStoryOptions()

void optionsController.copyStoryOptions ( )

this method make that the gameobject of the story options show the same choices that this class has stored on his attributes.

◆ distanceInKM()

bool optionsController.distanceInKM ( )

getter of the distanceInKM_ property.

Returns
true if the user has chosen the distance unit as kilometers, false if the user has chosen the distance unit as milles.

◆ saveOptions()

void optionsController.saveOptions ( )

this method store on this class attributes the user choices of the options screen and sets the optionsCopied_ property to true.

◆ socialOptions()

bool optionsController.socialOptions ( string  option)

getter of the given social option.

Parameters
stringsocial option that you want to access.
Returns
bool true if the social option is active, false in other case.

◆ sortByLessDistance()

bool optionsController.sortByLessDistance ( )

getter of the sortByLessDistance_ property.

Returns
true if the user has chosen to sort the places as less distance first, false if the user has chosen to sort the places as more visited first.

◆ sortStoryByFirstVisit()

bool optionsController.sortStoryByFirstVisit ( )

getter of the sortStoryByFirstVisit_ attribute.

Returns
bool true if the user has chose to sort first visit first on the story screen, false if the user has chose to sort the last visit first on the story screen.

◆ Start()

void optionsController.Start ( )
private

this method is called on the first frame. It check if the user has already stored some options on the current device, if that is not the case, it creates the option as activated. If the user has already stored some options it loads the options from the current device. It also intializes all the properties of the object.

◆ storeOptions()

void optionsController.storeOptions ( )
private

This method stores the options choices of the current user on the current device.

◆ Update()

void optionsController.Update ( )
private

this method is called each frame. First it checks if the options isnt copied and youre on the options screen or in the story screen and calls the copyOptions or the copyStoryOptions respectively. It also check if youre exiting the options screen or the story screen and if that is the case it calls the storeOptions method. If youre changing scene and youre on the options screen it finds and initialize the sortByLessDistanceMenu_, whatToSeeMenu_, distanceUnitMenu_, socialOptionsMenu_ properties and sets the optionsCopied_ as false. If youre changing scene and youre on the story screen it finds and initialize the sortStoryMenu_ property and sets the optionsCopied_ as false. If youre changing scene and youre neither on the story screen nor the options screen it sets the gameobject of the options as null.

◆ whatToSeeOptions()

Dictionary< string, bool > optionsController.whatToSeeOptions ( )

return a dictionary that contains an entry for each type of place, each entry has a boolean value that is true if the user chose he wants to see it and false if he dont want to see it. There is an aditional entry for choosing if the user wants to see places that he already had visited.

Returns
dictionary with one entry for each type of site, the value mean if the user want to see that type or not.

Member Data Documentation

◆ distanceInKM_

bool optionsController.distanceInKM_
private

true if the user has chosen to see the distance in Kilometers, false if the user has chosen to see the distance in Milles.

◆ distanceUnitMenu_

uniqueselectionDesplegableMenu optionsController.distanceUnitMenu_
private

reference to the game object of the chosing distance unit options.

◆ lastOptionClicked_

GameObject optionsController.lastOptionClicked_
static

reference to the last clicked option on the options screen.

◆ lastScene_

string optionsController.lastScene_
private

contains the name of the last scene that this object was.

◆ optionsControllerInstance_

optionsController optionsController.optionsControllerInstance_ = null
static

reference to the unique instance of the class that can exist on each execution.

◆ optionsCopied_

bool optionsController.optionsCopied_
private

true if the value of the options were asigned to the game object that represent those options.

◆ socialOptions_

Dictionary<string, bool> optionsController.socialOptions_
private

This dictionary has an entry for each social option, allow that other users can find me on the ranking, allow that other user can send me friendship invitations or allow that my friends can chanllege me.

◆ socialOptionsMenu_

multiselectionDesplegableMenu optionsController.socialOptionsMenu_
private

reference to the game object of the social options.

◆ sortByLessDistance_

bool optionsController.sortByLessDistance_
private

true if the user has chosen that places has to be sorted by less distance first, false if the user has chosen that places has to be sorted by more visited first.

◆ sortByLessDistanceMenu_

uniqueselectionDesplegableMenu optionsController.sortByLessDistanceMenu_
private

reference to the game object of the sorting places options.

◆ sortStoryByFirstVisit_

bool optionsController.sortStoryByFirstVisit_
private

true if the user has chosen that places on the story has to be sorted by first visited first, false if the user has chosen that the places on the story has to be sorted by most recent visited first.

◆ sortStoryMenu_

uniqueselectionDesplegableMenu optionsController.sortStoryMenu_
private

reference to the game object of the sorting places on the story options.

◆ whatToSee_

Dictionary<string, bool> optionsController.whatToSee_
private

This dictionary has an entry for each type of site. The key is the type of the site, and the value is if the user has chosen to see that type of site or not.

◆ whatToSeeMenu_

multiselectionDesplegableMenu optionsController.whatToSeeMenu_
private

reference to the game object of the what type of places you want to see options.


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