/*
wearechat - generic multiplayer game with voip
Copyright (C) 2025 metamuffin
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, version 3 of the License only.
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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
use crate::{
audio::Audio,
camera::Camera,
download::Downloader,
interfaces::{InterfaceData, ui_selector},
network::Network,
render::{Renderer, ui::UiEvent},
};
use anyhow::{Context, Result};
use glam::{Vec2, Vec3};
use log::{info, warn};
use std::{net::TcpStream, sync::Arc, time::Instant};
use weareshared::{
packets::{Data, Object, Packet, Resource},
resources::PrefabIndex,
store::ResourceStore,
tree::SceneTree,
};
use winit::event::MouseButton;
pub struct State<'a> {
pub network: Arc,
pub downloader: Arc,
pub renderer: Renderer<'a>,
pub tree: SceneTree,
pub camera: Camera,
pub input_state: InputState,
pub audio: Audio,
pub prefab_index: Arc,
pub prefab_index_res_loaded: Option>,
pub prefab_index_res: Option>,
pub avatar_ob: Option