Drag[en]gine Script Module DragonScript
1.23
|
Model for widgets allowing a user to rate somethig. More...
Public Member Functions | |
void | addListener (RatingModelListener listener) |
Add listener. More... | |
Dictionary | getCountsPerType () |
Breakdown of submitted ratings per rating type. More... | |
Integer | getRating () |
Rating or null. More... | |
int | getTypeCount () |
Count of rating types. More... | |
void | removeListener (RatingModelListener listener) |
Remove listener. More... | |
void | setCountsPerType (Dictionary countsPerType) |
Set breakdown of submitted ratings per rating type. More... | |
void | setRating (Integer rating) |
Set rating or null. More... | |
Model for widgets allowing a user to rate somethig.
Rating is stored as an integer value. If no rating is present the value is null. If not null the value ranges from 0 (lowest rating) to the maximum rating value.
Optionally a list of submitted ratings per rating type can be provided. This can be used by widgets to show the user a break down of how many ratings of a given type have been submitted. This list is stored as a Dictionary with int rating type (key) and float rating count (value).
void Dragengine.Gui.RatingModel.addListener | ( | RatingModelListener | listener | ) |
Add listener.
Dictionary Dragengine.Gui.RatingModel.getCountsPerType | ( | ) |
Breakdown of submitted ratings per rating type.
Dictionary has the rating type as key (int) and count for this rating type as value (float). For rating types not present in the dictionary a count of 0 has to be used.
Integer Dragengine.Gui.RatingModel.getRating | ( | ) |
Rating or null.
If not null the value is in the range from 0 to getTypeCount() - 1.
Implemented in Dragengine.Gui.DefaultRatingModel.
int Dragengine.Gui.RatingModel.getTypeCount | ( | ) |
Count of rating types.
The maximum rating value the user can submit is getTypeCount() - 1.
Implemented in Dragengine.Gui.DefaultRatingModel.
void Dragengine.Gui.RatingModel.removeListener | ( | RatingModelListener | listener | ) |
Remove listener.
void Dragengine.Gui.RatingModel.setCountsPerType | ( | Dictionary | countsPerType | ) |
Set breakdown of submitted ratings per rating type.
countsPerType | Dictionary with rating type as key (int) and count for this rating type as value (float). For rating types not present in the dictionary a count of 0 will be used. |
Implemented in Dragengine.Gui.DefaultRatingModel.
void Dragengine.Gui.RatingModel.setRating | ( | Integer | rating | ) |
Set rating or null.
rating | Rating in the range from 0 to getTypeCount() - 1 or null. |
Implemented in Dragengine.Gui.DefaultRatingModel.