Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
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.
Dictionary getCountsPerType ()
 Breakdown of submitted ratings per rating type.
Integer getRating ()
 Rating or null.
int getTypeCount ()
 Count of rating types.
void removeListener (RatingModelListener listener)
 Remove listener.
void setCountsPerType (Dictionary countsPerType)
 Set breakdown of submitted ratings per rating type.
void setRating (Integer rating)
 Set rating or null.

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.

Referenced by getCountsPerType().

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

References addListener(), and setCountsPerType().

Referenced by setRating().

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

References setRating().

Referenced by getTypeCount().

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

References getRating(), and getTypeCount().

Referenced by getTypeCount().

◆ removeListener()

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

Remove listener.

Referenced by setCountsPerType().

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

References removeListener().

Referenced by getCountsPerType().

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

References getCountsPerType().

Referenced by getRating().


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