<commit_before>package rpgboss.player

import java.io.File
import com.badlogic.gdx.backends.lwjgl._
import com.badlogic.gdx._
import org.scalatest.concurrent.AsyncAssertions.Waiter
import rpgboss.model.MapLoc
import java.util.Date
import org.lwjgl.opengl.Display

/** Can hold a delegate MyGame that can be replaced for running multiple tests.
 */
class TestGameContainer extends ApplicationListener {
  var childGame: Option[MyGame] = None
  
  // Can be called on any thread, since it will post to the Gdx thread.
  def replace(game: MyGame) = {
    Gdx.app.postRunnable(new Runnable() {
      def run() = {
        childGame.map(_.pause())
        childGame.map(_.dispose())
        childGame = Some(game)
        childGame.map(_.create())
      }
    })
  }
  
  def create() = {}
  
  def dispose() = {
    childGame.map(_.dispose())
  }
  
  def pause() = {
    childGame.map(_.pause())
  }
  
  def render() = {
    childGame.map(_.render())
  }
  
  def resize(x: Int, y: Int) = {
    childGame.map(_.resize(x, y))
  }
  
  def resume() = {
    childGame.map(_.resume())
  }
}

object TestPlayer {
  val container = new TestGameContainer
  var app: LwjglApplication = null
  
  def launch(game: MyGame) = {
    val conf = new LwjglApplicationConfiguration();
    conf.title = game.project.data.title;
    conf.width = 32 * 20;
    conf.height = 32 * 15;
    conf.useGL20 = true;
    conf.forceExit = false;

    if (app == null) {
      app = new LwjglApplication(container, conf)
    }
    
    container.replace(game)
  }
}<commit_msg>update tests to new libgdx<commit_after>package rpgboss.player

import java.io.File
import com.badlogic.gdx.backends.lwjgl._
import com.badlogic.gdx._
import org.scalatest.concurrent.AsyncAssertions.Waiter
import rpgboss.model.MapLoc
import java.util.Date
import org.lwjgl.opengl.Display

/** Can hold a delegate MyGame that can be replaced for running multiple tests.
 */
class TestGameContainer extends ApplicationListener {
  var childGame: Option[MyGame] = None

  // Can be called on any thread, since it will post to the Gdx thread.
  def replace(game: MyGame) = {
    Gdx.app.postRunnable(new Runnable() {
      def run() = {
        childGame.map(_.pause())
        childGame.map(_.dispose())
        childGame = Some(game)
        childGame.map(_.create())
      }
    })
  }

  def create() = {}

  def dispose() = {
    childGame.map(_.dispose())
  }

  def pause() = {
    childGame.map(_.pause())
  }

  def render() = {
    childGame.map(_.render())
  }

  def resize(x: Int, y: Int) = {
    childGame.map(_.resize(x, y))
  }

  def resume() = {
    childGame.map(_.resume())
  }
}

object TestPlayer {
  val container = new TestGameContainer
  var app: LwjglApplication = null

  def launch(game: MyGame) = {
    val conf = new LwjglApplicationConfiguration();
    conf.title = game.project.data.title;
    conf.width = 32 * 20;
    conf.height = 32 * 15;
    conf.forceExit = false;

    if (app == null) {
      app = new LwjglApplication(container, conf)
    }

    container.replace(game)
  }
}
{'fraction_non_alphanumeric': 0.12524525833878353, 'fraction_numerical': 0.005886200130804447, 'mean_word_length': 2.8189762796504367, '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': '3134351', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1039, 'n_words': 244}