use crate::types::AppState; use crate::ui::{playing_field, PlayingFieldView}; use std::sync::{Arc, RwLock}; pub enum Request { PlayingField, } #[derive(Debug)] pub enum Response { PlayingFieldView(PlayingFieldView), } #[derive(Clone)] pub struct CoreApp { state: Arc>, } impl CoreApp { pub fn new() -> Self { let state = Arc::new(RwLock::new(AppState::new())); Self { state } } pub async fn dispatch(&self, request: Request) -> Response { match request { Request::PlayingField => Response::PlayingFieldView(playing_field()), } } pub async fn run(&self) {} }