Drag[en]gine Script Module DragonScript  1.23
Dragengine.Gui.DefaultRatingModel Class Reference

Default implementation of RatingModel. More...

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

Public Member Functions

Integer getRating ()
 Rating or null. More...
 
int getTypeCount ()
 Count of rating types. More...
 
DefaultRatingModel new (int typeCount)
 Create default rating model. More...
 
DefaultRatingModel new (int typeCount, Integer rating)
 Create default rating model with initial rating. More...
 
DefaultRatingModel new (int typeCount, Integer rating, Dictionary countsPerType)
 Create default rating model with initial rating and counts per type. More...
 
void setCountsPerType (Dictionary countsPerType)
 Set breakdown of submitted ratings per rating type. More...
 
void setRating (Integer rating)
 Set rating or null. More...
 
- Public Member Functions inherited from Dragengine.Gui.RatingModel
void addListener (RatingModelListener listener)
 Add listener. More...
 
Dictionary getCountsPerType ()
 Breakdown of submitted ratings per rating type. More...
 
void removeListener (RatingModelListener listener)
 Remove listener. More...
 

Public Attributes

Dictionary pCountsPerType
 
Array pListeners
 
Integer pRating
 
int pTypeCount
 

Detailed Description

Default implementation of RatingModel.

Version
1.23

Member Function Documentation

◆ getRating()

Integer Dragengine.Gui.DefaultRatingModel.getRating ( )

Rating or null.

If not null the value is in the range from 0 to getTypeCount() - 1.

Implements Dragengine.Gui.RatingModel.

◆ getTypeCount()

int Dragengine.Gui.DefaultRatingModel.getTypeCount ( )

Count of rating types.

The maximum rating value the user can submit is getTypeCount() - 1.

Implements Dragengine.Gui.RatingModel.

◆ new() [1/3]

DefaultRatingModel Dragengine.Gui.DefaultRatingModel.new ( int  typeCount)

Create default rating model.

Parameters
typeCountCount of rating types.
Exceptions
EInvalidParamtypeCount is less than 1

◆ new() [2/3]

DefaultRatingModel Dragengine.Gui.DefaultRatingModel.new ( int  typeCount,
Integer  rating 
)

Create default rating model with initial rating.

Parameters
typeCountCount of rating types.
ratingRating in the range from 0 to getTypeCount() - 1 or null.
Exceptions
EInvalidParamtypeCount is less than 1

◆ new() [3/3]

DefaultRatingModel Dragengine.Gui.DefaultRatingModel.new ( int  typeCount,
Integer  rating,
Dictionary  countsPerType 
)

Create default rating model with initial rating and counts per type.

Parameters
typeCountCount of rating types.
ratingRating in the range from 0 to getTypeCount() - 1 or null.
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.
Exceptions
EInvalidParamtypeCount is less than 1

◆ setCountsPerType()

void Dragengine.Gui.DefaultRatingModel.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.

Implements Dragengine.Gui.RatingModel.

◆ setRating()

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

Set rating or null.

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

Implements Dragengine.Gui.RatingModel.

Member Data Documentation

◆ pCountsPerType

Dictionary Dragengine.Gui.DefaultRatingModel.pCountsPerType

◆ pListeners

Array Dragengine.Gui.DefaultRatingModel.pListeners

◆ pRating

Integer Dragengine.Gui.DefaultRatingModel.pRating

◆ pTypeCount

int Dragengine.Gui.DefaultRatingModel.pTypeCount

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