jong/src/main.rs

37 lines
629 B
Rust
Raw Normal View History

2026-01-08 20:49:19 -08:00
use bevy::prelude::*;
2026-01-07 00:51:57 -08:00
use clap::{Parser, Subcommand};
mod gui;
mod tui;
2026-01-07 00:51:57 -08:00
#[derive(Parser)]
struct Args {
#[command(subcommand)]
mode: Mode,
}
#[derive(Subcommand)]
enum Mode {
RunGui,
RunTui,
}
2026-01-05 23:24:42 -08:00
fn main() {
2026-01-08 23:58:26 -08:00
tracing_subscriber::fmt()
.with_writer(std::io::stderr)
.with_env_filter("warn,jong=trace")
.init();
2026-01-07 00:51:57 -08:00
let args = Args::parse();
let mut app = App::new();
let app = match args.mode {
Mode::RunGui => app.add_plugins(DefaultPlugins),
2026-01-08 20:49:19 -08:00
Mode::RunTui => app.add_plugins(tui::RiichiTui),
2026-01-07 00:51:57 -08:00
};
2026-01-08 21:35:16 -08:00
app.add_plugins(jong::game::Riichi);
2026-01-07 00:51:57 -08:00
app.run();
}