All Data Structures Functions Variables Pages
Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions | Static Protected Member Functions | Protected Attributes
GameHelper Class Reference
Inheritance diagram for GameHelper:

Public Member Functions

 setModalNotificationsEnabled ($value)
 
 setModalCollectionsEnabled ($value)
 
 setModalCoinsEnabled ($value)
 
 getModalNotificationsEnabled ()
 
 getModalCollectionsEnabled ()
 
 getModalCoinsEnabled ()
 
 init ()
 
 resetDeferredPointTypesAndValuesByUserIdToAdd ()
 
 getDeferredPointTypesAndValuesByUserIdToAdd ()
 
 isScoringModelsOnSaveMuted ()
 
 muteScoringModelsOnSave ()
 
 unmuteScoringModelsOnSave ()
 
 muteScoringModelsOnDelete ()
 
 unmuteScoringModelsOnDelete ()
 
 initCustom ()
 
 triggerSearchModelsEvent ($modelClassName)
 
 triggerMassEditEvent ($modelClassName)
 
 triggerMassDeleteEvent ($modelClassName)
 
 triggerImportEvent ($modelClassName)
 
 processDeferredPoints ()
 
 resolveLevelChange ()
 
 resolveNewCollectionItems ()
 
 resolveNewBadges ()
 

Static Public Member Functions

static addPointsByUserDeferred (User $user, $type, $value)
 

Data Fields

 $enabled = true
 

Protected Member Functions

 resolveLevelChangeByType ($levelType, GameLevel $currentGameLevel, $pointSumsIndexedByType)
 

Static Protected Member Functions

static resolveSummationValueByLevelTypeAndPointSums ($levelType, $pointSumsIndexedByType)
 
static processLevelChangeGameNotification ($nextLevelValue)
 

Protected Attributes

 $_modalNotificationsEnabled
 
 $_modalCollectionsEnabled
 
 $_modalCoinsEnabled
 
 $scoringModelsOnSaveIsMuted = false
 
 $scoringModelsOnDeleteIsMuted = false
 

Detailed Description

Helps with game logic exuected during a page request. As scores are added, the point information is tabulated in the GamePointManager so it can then update persistent storage in a single request at the end of the page request.

Definition at line 42 of file GameHelper.php.

Member Function Documentation

initCustom ( )

Override as needed to customize various aspects of gamification. A few examples of things you can do here: GeneralGameLevelRules::setLastLevel(100); GeneralGameLevelRules::setLevelPointMap($newLevelPointMap);

Definition at line 187 of file GameHelper.php.

triggerSearchModelsEvent (   $modelClassName)
Parameters
string$modelClassName

Definition at line 194 of file GameHelper.php.

triggerMassEditEvent (   $modelClassName)
Parameters
string$modelClassName

Definition at line 208 of file GameHelper.php.

triggerMassDeleteEvent (   $modelClassName)
Parameters
string$modelClassName,(massdelete)

Definition at line 222 of file GameHelper.php.

triggerImportEvent (   $modelClassName)
Parameters
string$modelClassName

Definition at line 236 of file GameHelper.php.

static addPointsByUserDeferred ( User  $user,
  $type,
  $value 
)
static

Given a user, point type, and value, store the information in the

See Also
$pointTypesAndValuesByUserIdToAdd data array to be processed later at the end of the page request by
processDeferredPoints
Parameters
User$user
String$type
Integer$value

Definition at line 254 of file GameHelper.php.

processDeferredPoints ( )

Process any points that have been added to

See Also
$pointTypesAndValuesByUserIdToAdd throughout the page request.

Definition at line 274 of file GameHelper.php.

resolveLevelChange ( )

Called at the end of the page request. Processes anylevel changes for the current user.

Definition at line 304 of file GameHelper.php.

resolveLevelChangeByType (   $levelType,
GameLevel  $currentGameLevel,
  $pointSumsIndexedByType 
)
protected
Parameters
string$levelType
GameLevel$currentGameLevel
array$pointSumsIndexedByType
Exceptions
FailedToSaveModelException

Definition at line 338 of file GameHelper.php.

static resolveSummationValueByLevelTypeAndPointSums (   $levelType,
  $pointSumsIndexedByType 
)
staticprotected
Parameters
string$levelType
array$pointSumsIndexedByType
Returns
int|number

Definition at line 378 of file GameHelper.php.

static processLevelChangeGameNotification (   $nextLevelValue)
staticprotected
Parameters
int$nextLevelValue
Exceptions
FailedToSaveModelException

Definition at line 403 of file GameHelper.php.

resolveNewBadges ( )

Called at the end of the page request. Processes any new badges or badge grade changes for the current user.

Definition at line 427 of file GameHelper.php.


The documentation for this class was generated from the following file:
Generated on Thu Jun 4 2020 07:10:47