Drag[en]gine Script Module DragonScript  1.23
Dragengine.Gui.RatingModel Interface Reference

Model for widgets allowing a user to rate somethig. More...

Inheritance diagram for Dragengine.Gui.RatingModel:
Dragengine.Gui.DefaultRatingModel

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...
 

Detailed Description

Model for widgets allowing a user to rate somethig.

Version
1.23

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).

Member Function Documentation

◆ addListener()

void Dragengine.Gui.RatingModel.addListener ( RatingModelListener  listener)

Add listener.

◆ getCountsPerType()

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.

◆ getRating()

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.

◆ getTypeCount()

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.

◆ removeListener()

void Dragengine.Gui.RatingModel.removeListener ( RatingModelListener  listener)

Remove listener.

◆ setCountsPerType()

void Dragengine.Gui.RatingModel.setCountsPerType ( Dictionary  countsPerType)

Set breakdown of submitted ratings per rating type.

Parameters
countsPerTypeDictionary 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.

◆ setRating()

void Dragengine.Gui.RatingModel.setRating ( Integer  rating)

Set rating or null.

Parameters
ratingRating in the range from 0 to getTypeCount() - 1 or null.

Implemented in Dragengine.Gui.DefaultRatingModel.


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