EN605.607.81.SP22_ASDM_Project/front_end/src/main.rs

38 lines
1.3 KiB
Rust
Raw Normal View History

2022-04-06 11:49:54 +00:00
//Four Line Dropper Frontend - A webapp that allows one to play a game of Four Line Dropper
//Copyright (C) 2022 Stephen Seo
//
//This program 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.
//
//This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
2022-03-07 04:15:53 +00:00
mod ai;
mod constants;
mod game_logic;
mod html_helper;
mod random_helper;
mod state;
mod yew_components;
use state::SharedState;
use yew::prelude::*;
use yew_components::Wrapper;
2022-02-28 07:53:01 +00:00
#[function_component(App)]
pub fn app() -> Html {
2022-02-28 07:53:01 +00:00
let ctx = use_state(SharedState::default);
html! {
<ContextProvider<SharedState> context={(*ctx).clone()}>
<Wrapper />
</ContextProvider<SharedState>>
}
}
2022-02-28 04:49:40 +00:00
fn main() {
// setup logging to browser console
wasm_logger::init(wasm_logger::Config::default());
// start webapp
yew::start_app::<App>();
2022-02-28 04:49:40 +00:00
}