GameHelper Class Reference

Public Member Functions

 setModalNotificationsEnabled ($value)
 getModalNotificationsEnabled ()
 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
 $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 137 of file GameHelper.php.

triggerSearchModelsEvent ( modelClassName  ) 
Parameters:
string $modelClassName

Definition at line 144 of file GameHelper.php.

triggerMassEditEvent ( modelClassName  ) 
Parameters:
string $modelClassName

Definition at line 158 of file GameHelper.php.

triggerMassDeleteEvent ( modelClassName  ) 
Parameters:
string $modelClassName(mass delete)

Definition at line 172 of file GameHelper.php.

triggerImportEvent ( modelClassName  ) 
Parameters:
string $modelClassName

Definition at line 186 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 204 of file GameHelper.php.

processDeferredPoints (  ) 

Process any points that have been added to

See also:
$pointTypesAndValuesByUserIdToAdd throughout the page request.

Definition at line 224 of file GameHelper.php.

resolveLevelChange (  ) 

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

Definition at line 254 of file GameHelper.php.

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

Definition at line 288 of file GameHelper.php.

static resolveSummationValueByLevelTypeAndPointSums ( levelType,
pointSumsIndexedByType 
) [static, protected]
Parameters:
string $levelType
array $pointSumsIndexedByType
Returns:
int|number

Definition at line 328 of file GameHelper.php.

static processLevelChangeGameNotification ( nextLevelValue  )  [static, protected]
Parameters:
int $nextLevelValue
Exceptions:
FailedToSaveModelException 

Definition at line 353 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 377 of file GameHelper.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Sun Oct 22 07:10:24 2017