Class that stores the data of one of the stored places.
More...
|
static bool | storePlace (Place place) |
| This method stores the properties of the stored place on the current device. If the user cant save more places it returns false, it returns true in other case. The maximum quantity of places that the user can store is defined on the gameRules class. More...
|
|
static StoredPlace | loadStoredPlace (int index) |
| It checks if the current device has stored the asked place, if that is not the case, it returns null, if that is the case it returns a StoredPlace object with the stored information on the given index. More...
|
|
static bool | thereIsAPlaceStoredIn (int index) |
| This method return true if exists a place stored on the given position, it returns false in other case. More...
|
|
static bool | isPlaceStoredByName (string name) |
| This method returns true if there is a place stored that has the given name, false in other case. More...
|
|
static bool | thereIsAnyPlaceStored () |
| This method returns false if you dont have any place stored, it returns true in other case. More...
|
|
static bool | thereIsSpaceForOtherPlaceStored () |
| This method returns true if the current user can store one or more places, it returns false if the current user cant store more places. More...
|
|
static void | eraseStoredData () |
| This method delete all the stored information on the current device. It also sets the static property changesToUpdate_ to false. More...
|
|
static void | eraseStoredDataOf (int index) |
| This method deletes all the information of the place that is on the given index. If there isnt any information on that position it wont do nothing. More...
|
|
static void | saveStoredPlace (StoredPlace storedPlace) |
| This method saves on the current device the changes of the given stored place. If the given place isnt stored, it will show a message on the console. More...
|
|
static void | saveAll () |
| Calls the PlayerPrefs's Save method in order to write on the current device all the stored information. More...
|
|
static void | UploadChanges () |
| This method calls the userVisitedPlaceByName with each of the stored places that have been visited and they didnt uploaded the changes. More...
|
|
|
| StoredPlace (Dictionary< string, string > data) |
| Constructor, it initialices all the properties of the class. It expects a dictionary with the following entries: name_, address_, latitude_, longitude_, zone_, lastVisitTimestamp_, newVisitsForThisPlace_ and visited_. More...
|
|
Class that stores the data of one of the stored places.
◆ StoredPlace()
StoredPlace.StoredPlace |
( |
Dictionary< string, string > |
data | ) |
|
|
private |
Constructor, it initialices all the properties of the class. It expects a dictionary with the following entries: name_, address_, latitude_, longitude_, zone_, lastVisitTimestamp_, newVisitsForThisPlace_ and visited_.
- Parameters
-
Dictionary | with the string conversion of the data of the stored place. |
◆ eraseStoredData()
static void StoredPlace.eraseStoredData |
( |
| ) |
|
|
static |
This method delete all the stored information on the current device. It also sets the static property changesToUpdate_ to false.
◆ eraseStoredDataOf()
static void StoredPlace.eraseStoredDataOf |
( |
int |
index | ) |
|
|
static |
This method deletes all the information of the place that is on the given index. If there isnt any information on that position it wont do nothing.
- Parameters
-
int | position of the place that you want to erase. |
◆ getAddress()
string StoredPlace.getAddress |
( |
| ) |
|
getter of the address_ property.
- Returns
- string that contains the property address_'s value.
◆ getLatitude()
double StoredPlace.getLatitude |
( |
| ) |
|
getter of the latitude_ property.
- Returns
- double that contains the property latitude_'s value.
◆ getLongitude()
double StoredPlace.getLongitude |
( |
| ) |
|
getter of the longitude_ property.
- Returns
- double that contains the property longitude_'s value.
◆ getName()
string StoredPlace.getName |
( |
| ) |
|
getter of the name_ property.
- Returns
- string that contains the property name_'s value.
◆ getZone()
string StoredPlace.getZone |
( |
| ) |
|
getter of the zone_ property.
- Returns
- string that contains the property zone_'s value.
◆ isPlaceStoredByName()
static bool StoredPlace.isPlaceStoredByName |
( |
string |
name | ) |
|
|
static |
This method returns true if there is a place stored that has the given name, false in other case.
- Parameters
-
string | name of the place that you want to check if its stored. |
- Returns
- bool true if there is a place stored with the given name.
◆ lastVisitTimestamp()
long StoredPlace.lastVisitTimestamp |
( |
| ) |
|
getter of the lastVisitTimestamp_ property.
- Returns
- long that contains the property lastVisitTimestamp_'s value.
◆ loadStoredPlace()
static StoredPlace StoredPlace.loadStoredPlace |
( |
int |
index | ) |
|
|
static |
It checks if the current device has stored the asked place, if that is not the case, it returns null, if that is the case it returns a StoredPlace object with the stored information on the given index.
- Parameters
-
int | index of the stored place you want to obtain. |
- Returns
- StoredPlace that is on the index-th position, It can be null.
◆ newVisitsForThisPlace()
int StoredPlace.newVisitsForThisPlace |
( |
| ) |
|
getter of the newVisitsForThisPlace_ property.
- Returns
- int that contains the property newVisitsForThisPlace_'s value.
◆ oneMoreVisit()
void StoredPlace.oneMoreVisit |
( |
| ) |
|
Register a new visit to the represented stored place. It uses the current timestamp. It changes the visited_ property to true. It also set the changesToUpdtate_ static property to true.
◆ saveAll()
static void StoredPlace.saveAll |
( |
| ) |
|
|
static |
Calls the PlayerPrefs's Save method in order to write on the current device all the stored information.
◆ saveStoredPlace()
static void StoredPlace.saveStoredPlace |
( |
StoredPlace |
storedPlace | ) |
|
|
static |
This method saves on the current device the changes of the given stored place. If the given place isnt stored, it will show a message on the console.
- Parameters
-
◆ storePlace()
static bool StoredPlace.storePlace |
( |
Place |
place | ) |
|
|
static |
This method stores the properties of the stored place on the current device. If the user cant save more places it returns false, it returns true in other case. The maximum quantity of places that the user can store is defined on the gameRules class.
- Parameters
-
- Returns
- true if the given place was stored, false in other case.
◆ thereIsAnyPlaceStored()
static bool StoredPlace.thereIsAnyPlaceStored |
( |
| ) |
|
|
static |
This method returns false if you dont have any place stored, it returns true in other case.
- Returns
- true if there is one or more places stored, false in other case.
◆ thereIsAPlaceStoredIn()
static bool StoredPlace.thereIsAPlaceStoredIn |
( |
int |
index | ) |
|
|
static |
This method return true if exists a place stored on the given position, it returns false in other case.
- Parameters
-
int | position that you want to check if there is a stored place. |
- Returns
- bool true if exists a place stored on that position, false in other case.
◆ thereIsSpaceForOtherPlaceStored()
static bool StoredPlace.thereIsSpaceForOtherPlaceStored |
( |
| ) |
|
|
static |
This method returns true if the current user can store one or more places, it returns false if the current user cant store more places.
- Returns
- true if the current user can store another place.
◆ UploadChanges()
static void StoredPlace.UploadChanges |
( |
| ) |
|
|
static |
This method calls the userVisitedPlaceByName with each of the stored places that have been visited and they didnt uploaded the changes.
◆ visited()
bool StoredPlace.visited |
( |
| ) |
|
getter of the visited_ property.
- Returns
- bool that contains the property visited_'s value.
◆ address_
string StoredPlace.address_ |
|
private |
string that stores the address of the stored place.
◆ changesToUpdate_
bool StoredPlace.changesToUpdate_ = true |
|
static |
true if any of the stored places has changes to update.
◆ lastVisitTimestamp_
long StoredPlace.lastVisitTimestamp_ |
|
private |
long that contains the timestamp of the last visit.
◆ latitude_
float StoredPlace.latitude_ |
|
private |
float that stores the latitude of the stored place.
◆ longitude_
float StoredPlace.longitude_ |
|
private |
float that stores the longitude of the stored place.
◆ name_
string that stores the name of the stored place.
◆ newVisitsForThisPlace_
int StoredPlace.newVisitsForThisPlace_ |
|
private |
int that stores the number of new visits to this stored place.
◆ visited_
bool StoredPlace.visited_ |
|
private |
Boolean value, its true when the stored place was already visited.
◆ zone_
string that stores the zone that the stored place belongs.
The documentation for this class was generated from the following file: