<commit_before>package com.mogproject.mogami.playground.controller.mode

import com.mogproject.mogami.playground.controller.Configuration
import com.mogproject.mogami.playground.view.Renderer
import com.mogproject.mogami.Game
import com.mogproject.mogami.util.Implicits._

/**
  * View mode
  */
case class ViewModeController(renderer: Renderer,
                              config: Configuration,
                              game: Game,
                              displayPosition: Int
                             ) extends GameController {
  val mode: Mode = Viewing

  override def copy(config: Configuration, game: Game, displayPosition: Int): GameController =
    ViewModeController(renderer, config, game, displayPosition)

}<commit_msg>access to game information in View Mode<commit_after>package com.mogproject.mogami.playground.controller.mode

import com.mogproject.mogami.playground.controller.{Configuration, Cursor}
import com.mogproject.mogami.playground.view.Renderer
import com.mogproject.mogami.Game

/**
  * View mode
  */
case class ViewModeController(renderer: Renderer,
                              config: Configuration,
                              game: Game,
                              displayPosition: Int
                             ) extends GameController {
  val mode: Mode = Viewing

  override def copy(config: Configuration, game: Game, displayPosition: Int): GameController =
    ViewModeController(renderer, config, game, displayPosition)

  override def canActivate(cursor: Cursor): Boolean = cursor.isPlayer

  override def invokeCursor(selected: Cursor, invoked: Cursor): Option[ModeController] = {
    if (invoked.isPlayer) renderer.showGameInfoModal(config, game.gameInfo)
    None
  }
}
{'fraction_non_alphanumeric': 0.08108108108108109, 'fraction_numerical': 0.0, 'mean_word_length': 2.7991266375545854, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '144509', 'n_tokens_mistral': 459, 'n_tokens_neox': 439, 'n_words': 105}