You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: gamearea.rs
    path of file: ./repos/conwayste/conwayste/src/ui
    
    the code of the file until where you have to start completion: /*  Copyright 2020 the Conwayste Developers.
 *
 *  This file is part of conwayste.
 *
 *  conwayste is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  conwayste is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with conwayste.  If not, see
 *  <http://www.gnu.org/licenses/>. */

use super::{
    context::{EmitEvent, Event, EventType, Handled, HandlerData, KeyCodeOrChar, UIContext},
    widget::Widget,
    UIError, UIResult,
};
use crate::{config::Config, constants::*, viewport::ZoomDirection};
use conway::{
    error::ConwayError,
    grids::{BitGrid, CharGrid, Rotation},
    rle::Pattern,
    universe::{BigBang, CellState, PlayerBuilder, Region, Universe},
    ConwayResult,
};
use ggez::graphics::Rect;
use ggez::input::keyboard::KeyCode;
use ggez::mint::{Point2, Vector2};
use ggez::{Context, GameResult};
use id_tree::NodeId;
use std::error::Error;
use std::fmt;

pub struct GameArea {
    id:                     Option<NodeId>,
    pub has_keyboard_focus: bool,
    z_index:                usize,
    dimensions:             Rect,
    handler_data:           HandlerData,
    pub uni:                Universe,
    game_state:             GameAreaState,
}

impl fmt::Debug for GameArea {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.debug_struct("GameArea")
            .field("id", &self.id)
            .field("has_keyboard_focus", &self.has_keyboard_focus)
            .finish()
    }
}

/// For no
    
    pub fn new() -> Self {
        // we're going to have to tear this all out when this becomes a real game
        let player0_writable = Region::new(100, 70, 34, 16);
        let player1_writable = Region::new(0, 0, 80, 80);

        let player0 = PlayerBuilder::new(player0_writable);
        let player1 = PlayerBuilder::new(player1_writable);
        let players = vec![player0, player1];

        let bigbang = BigBang::new()
            .width(UNIVERSE_WIDTH_IN_CELLS)
            .height(UNIVERSE_HEIGHT_IN_CELLS)
            .server_mode(true) // TODO will change to false once we get server support up
            // Currently 'client' is technically both client and server
            .history(HISTORY_SIZE)
            .fog_radius(FOG_RADIUS)
            .add_players(players)
            .birth();
        let mut uni = bigbang.unwrap();

        init_patterns(&mut uni).unwrap();

        let mut game_area = GameArea {
            id:                 None,
            has_keyboard_focus: false,
            z_index:            0,
            dimensions:         Rect::default(),
            handler_data:       HandlerData::new(),
            uni:                uni,
            game_state:         GameAreaState::default(),
        };

        // Set handlers for toggling has_keyboard_focus.
        // The unwrap calls on each handler registration below are all OK. The unwrap is not taking
        // place within an handler or emit call.
        game_area
            .on(EventType::GainFocus, Box::new(GameArea::gain_focus_handler))
            .unwrap();
        game_area
            .on(EventType::LoseFocus, Box::new(GameArea::lose_focus_handler))
            .unwrap();
        game_area
            .on(EventType::Update, Box::new(GameArea::update_handler))
            .unwrap();
        game_area
            .on(EventType::KeyPress, Box::new(GameArea::keypress_handler))
            .unwrap();
        game_area
            .on(EventType::Click, Box::new(GameArea::mouse_handler))
            .unwrap();
        game_area
            .on(EventType::MouseButtonHeld, Box::new(GameArea::mouse_handler))
            .unwrap();
        game_area
            .on(EventType::Drag, Box::new(GameArea::mouse_handler))
            .unwrap();

        game_area
    }