use crate::error::LobbyError;
use crate::op_payloads::RoomSettings;
use crate::room::RoomHandle;
use std::sync::Arc;
use crate::RoomId;
use async_trait::async_trait;
use plaza::agent::AgentId;
use serde::{Deserialize, Serialize};
use std::fmt::Debug;
#[async_trait]
pub trait RoomFactory: Send + Sync + 'static {
type CustomGameSettings: Clone + Debug + Send + Sync + 'static + Serialize + for<'de> Deserialize<'de> + Default;
type GameOp: Clone + Debug + Send + Sync + 'static + Serialize + for<'de> Deserialize<'de>;
type GameID: AgentId;
type GameStateType: Clone + Debug + Send + Sync + 'static + Default;
async fn spawn_room(
&self,
room_id: RoomId,
room_settings: &RoomSettings<Self::CustomGameSettings>,
) -> Result<Arc<dyn RoomHandle<Self::GameID, Self::CustomGameSettings>>, LobbyError>;
}