<commit_before>#[macro_use]
mod game;

use std::cell::{RefCell, RefMut};

extern crate gfx_device_gl;
extern crate piston_window;

use game::{Config, ConfigBuilder, Menu, MenuResult, Game, GameOver, GameWindow, Scene, SceneResult};

fn main() {
    let mut window = GameWindow::new(450, 600, "TetRS");
    let config = ConfigBuilder::new()
        .grid_size((10, 22))
        .grid_offset(10.0)
        .tile_size(29.0)
        .shadow(false)
        .ui_color([1.0; 4])
        .build();

    let main_menu = RefCell::new(create_main_menu(config, &window));
    let pause_menu = RefCell::new(create_pause_menu(config, &window));

    let game = RefCell::new(Game::new(config, window.piston_window.factory.clone()));
    let gameover = RefCell::new(GameOver::new(config, window.piston_window.factory.clone()));

    let mut scene: RefMut<Scene> = main_menu.borrow_mut();

    while let Some(e) = window.next() {

        let scene_result = scene.process(&e);

        match scene_result {
            SceneResult::MainMenu => {
                scene = main_menu.borrow_mut();
            }
            SceneResult::NewGame => {
                game.borrow_mut().reset();
                scene = game.borrow_mut();
            }
            SceneResult::PauseGame => {
                scene = pause_menu.borrow_mut();
            }
            SceneResult::ResumeGame => {
                game.borrow_mut().unpause();
                scene = game.borrow_mut();
            }
            SceneResult::GameOver => {<commit_msg>Slight cleanup<commit_after>#[macro_use]
mod game;

use std::cell::{RefCell, RefMut};

extern crate gfx_device_gl;
extern crate piston_window;

use game::{Config, ConfigBuilder, Menu, MenuResult, Game, GameOver, GameWindow, Scene, SceneResult};

fn main() {
    let mut window = GameWindow::new(450, 600, "TetRS");
    let config = ConfigBuilder::new()
        .grid_size((10, 22))
        .grid_offset(10.0)
        .tile_size(29.0)
        .shadow(false)
        .ui_color([1.0; 4])
        .build();

    let main_menu = RefCell::new(create_main_menu(config, &window));
    let pause_menu = RefCell::new(create_pause_menu(config, &window));

    let game = RefCell::new(Game::new(config, window.piston_window.factory.clone()));
    let gameover = RefCell::new(GameOver::new(config, window.piston_window.factory.clone()));

    let mut scene: RefMut<Scene> = main_menu.borrow_mut();

    while let Some(e) = window.next() {
        match scene.process(&e) {
            SceneResult::MainMenu => {
                scene = main_menu.borrow_mut();
            }
            SceneResult::NewGame => {
                game.borrow_mut().reset();
                scene = game.borrow_mut();
            }
            SceneResult::PauseGame => {
                scene = pause_menu.borrow_mut();
            }
            SceneResult::ResumeGame => {
                game.borrow_mut().unpause();
                scene = game.borrow_mut();
            }
            SceneResult::GameOver => {
{'fraction_non_alphanumeric': 0.14095744680851063, 'fraction_numerical': 0.012632978723404254, 'mean_word_length': 2.3808988764044945, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '5950135', 'n_tokens_mistral': 977, 'n_tokens_neox': 912, 'n_words': 170}