<commit_before>Engine.GameState = (I, self) ->
  Object.reverseMerge I,
    currentState: GameState()

  requestedState = null

  # The idea is that all the engine#beforeUpdate triggers happen
  # before the state beforeUpdate triggers, then the state update
  # then the state after update, then the engine after update
  # like a layered cake with states in the middle.
  self.bind "update", ->
    I.currentState.trigger "beforeUpdate"
    I.currentState.trigger "update"
    I.currentState.trigger "afterUpdate"

  self.bind "afterUpdate", ->
    # Handle state change
    if requestedState?
      I.currentState.trigger "exit", requestedState
      self.trigger 'stateEntere'

      previousState = I.currentState
      I.currentState = requestedState

      I.currentState.trigger "enter", previousState

      requestedState = null

  self.bind "draw", (canvas) ->
    I.currentState.trigger "beforeDraw", canvas
    I.currentState.trigger "draw", canvas
    I.currentState.trigger "overlay", canvas

  # We must always return self as the last line
  return {<commit_msg>Modified in browser at pixie.strd6.com<commit_after>Engine.GameState = (I, self) ->
  Object.reverseMerge I,
    currentState: GameState()

  requestedState = null

  # The idea is that all the engine#beforeUpdate triggers happen
  # before the state beforeUpdate triggers, then the state update
  # then the state after update, then the engine after update
  # like a layered cake with states in the middle.
  self.bind "update", ->
    I.currentState.trigger "beforeUpdate"
    I.currentState.trigger "update"
    I.currentState.trigger "afterUpdate"

  self.bind "afterUpdate", ->
    # Handle state change
    if requestedState?
      I.currentState.trigger "exit", requestedState
      self.trigger 'stateEntered', 

      previousState = I.currentState
      I.currentState = requestedState

      I.currentState.trigger "enter", previousState

      requestedState = null

  self.bind "draw", (canvas) ->
    I.currentState.trigger "beforeDraw", canvas
    I.currentState.trigger "draw", canvas
    I.currentState.trigger "overlay", canvas

  # We must always return self as the last line
  return {
{'fraction_non_alphanumeric': 0.08653846153846154, 'fraction_numerical': 0.0004578754578754579, 'mean_word_length': 3.423076923076923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '492102', 'n_tokens_mistral': 612, 'n_tokens_neox': 592, 'n_words': 198}