2022-03-07 04:15:53 +00:00
|
|
|
mod ai;
|
2022-03-02 06:38:24 +00:00
|
|
|
mod constants;
|
2022-03-09 07:22:01 +00:00
|
|
|
mod game_logic;
|
2022-03-09 08:29:53 +00:00
|
|
|
mod html_helper;
|
2022-03-09 07:22:01 +00:00
|
|
|
mod random_helper;
|
2022-03-02 06:18:10 +00:00
|
|
|
mod state;
|
|
|
|
mod yew_components;
|
2022-02-28 07:40:38 +00:00
|
|
|
|
2022-03-02 06:18:10 +00:00
|
|
|
use state::SharedState;
|
|
|
|
use yew::prelude::*;
|
2022-03-02 06:38:24 +00:00
|
|
|
use yew_components::Wrapper;
|
2022-02-28 07:53:01 +00:00
|
|
|
|
2022-02-28 07:40:38 +00:00
|
|
|
#[function_component(App)]
|
2022-03-02 06:18:10 +00:00
|
|
|
pub fn app() -> Html {
|
2022-02-28 07:53:01 +00:00
|
|
|
let ctx = use_state(SharedState::default);
|
2022-02-28 07:40:38 +00:00
|
|
|
html! {
|
|
|
|
<ContextProvider<SharedState> context={(*ctx).clone()}>
|
|
|
|
<Wrapper />
|
|
|
|
</ContextProvider<SharedState>>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-28 04:49:40 +00:00
|
|
|
fn main() {
|
2022-03-01 07:02:59 +00:00
|
|
|
// setup logging to browser console
|
|
|
|
wasm_logger::init(wasm_logger::Config::default());
|
|
|
|
|
|
|
|
// start webapp
|
2022-02-28 07:40:38 +00:00
|
|
|
yew::start_app::<App>();
|
2022-02-28 04:49:40 +00:00
|
|
|
}
|