mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-14 19:55:02 +01:00
40 lines
668 B
Rust
40 lines
668 B
Rust
use clap::Parser;
|
|
use crate::{command::Cmd, math::WorldPos};
|
|
#[derive(Parser)]
|
|
pub enum CmdLine {
|
|
Quit,
|
|
Freecam,
|
|
Clear,
|
|
Tp(Tp),
|
|
Spawn,
|
|
Give(Give),
|
|
}
|
|
#[derive(Parser)]
|
|
pub struct Tp {
|
|
x: u32,
|
|
y: u32,
|
|
/// Relative to current position
|
|
#[arg(short, long)]
|
|
rel: bool,
|
|
}
|
|
impl Tp {
|
|
fn to_world_pos(&self) -> WorldPos {
|
|
loop {}
|
|
}
|
|
}
|
|
#[derive(Parser)]
|
|
pub struct Give {
|
|
name: String,
|
|
}
|
|
pub enum Dispatch {
|
|
Cmd(Cmd),
|
|
ClearConsole,
|
|
}
|
|
impl CmdLine {
|
|
pub fn parse_cmdline(cmdline: &str) -> anyhow::Result<Self> {
|
|
loop {}
|
|
}
|
|
pub(crate) fn dispatch(self) -> Dispatch {
|
|
loop {}
|
|
}
|
|
}
|