<commit_before>goog.provide 'acorn.player.Player'

goog.require 'acorn.player.PlayerView'
goog.require 'acorn.shells.Shell'

# The main class, represents the entire player object.
# Also serves as the eventhub.
class acorn.player.Player

  # mixin Backbone.Events (not a class)
  _.extend @prototype, Backbone.Events

  constructor: (@options) ->
    @initialize()

  initialize: =>
    @acornModel = @options.acornModel # TODO initialize from id or data
    @shellModel = acorn.shellWithAcorn @acornModel

    @view = new acorn.player.PlayerView
      model:
        shellid: 'acorn.Shell',
        acornModel: @acornModel,
        shellModel: @shellModel
      eventhub: @<commit_msg>Player: trigger show:splash on init<commit_after>goog.provide 'acorn.player.Player'

goog.require 'acorn.player.PlayerView'
goog.require 'acorn.shells.Shell'

# The main class, represents the entire player object.
# Also serves as the eventhub.
class acorn.player.Player

  # mixin Backbone.Events (not a class)
  _.extend @prototype, Backbone.Events

  constructor: (@options) ->
    @initialize()

  initialize: =>
    @acornModel = @options.acornModel # TODO initialize from id or data
    @shellModel = acorn.shellWithAcorn @acornModel
    @eventhub = @

    @view = new acorn.player.PlayerView
      model:
        shellid: 'acorn.Shell',
        acornModel: @acornModel,
        shellModel: @shellModel
      eventhub: @eventhub

    @eventhub.trigger 'show:splash'
{'fraction_non_alphanumeric': 0.10432395332875773, 'fraction_numerical': 0.0, 'mean_word_length': 3.5, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1745721', 'n_tokens_mistral': 466, 'n_tokens_neox': 453, 'n_words': 118}