SENEventHandlerUtilityMethods

class modules.js.Utility.SENEventHandlerUtilityMethods()

Module holding methods that create and remove event handlers for pieces on the board

modules.js.Utility.SENEventHandlerUtilityMethods.SENEventHandlerUtilityMethods
modules.js.Utility.SENEventHandlerUtilityMethods.onClickCharacter(event)
Arguments
  • event (Event()) –

modules.js.Utility.SENEventHandlerUtilityMethods.onClickSquareAvailable(event)

onClick event handler for available squares when a stone has been selected, will fire the recordStoneMove method when clicked

Arguments
  • event (Event()) –

modules.js.Utility.SENEventHandlerUtilityMethods.onClickStoneAvailable(event)

onClick event handler for

Arguments
  • event (Event()) –

modules.js.Utility.SENEventHandlerUtilityMethods.onClickStones(event)

onClick event handler for a stone. If the stone doesn’t have a character, it will highlight the possible destination, if the character has been selected and the stone is reachable by the character, it will fire the recordCharacter move action. If another stone is already selected, then the highlighting will be changed accordingly

Arguments
  • event (Event()) –

modules.js.Utility.SENEventHandlerUtilityMethods.prepareCharacterEventHandler()

Attaches the event handlers to the character if it can be moved

modules.js.Utility.SENEventHandlerUtilityMethods.prepareStoneEventHandlers()

Attaches the event handlers to the stones without a character

modules.js.Utility.SENEventHandlerUtilityMethods.removePreviousAvailableHandlers()

Removes all the previously created handlers to avoid memory leaks. Also resets CSS classes.