diff options
author | Katharina Fey <kookie@spacekookie.de> | 2021-02-14 00:06:14 +0100 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2021-02-14 00:06:14 +0100 |
commit | effbdeed66e8de8e769b8ac069926ad1a9110e62 (patch) | |
tree | e4522354e53266204aa9962caccde55d8c815092 /games/rstnode/rst-client/src/state/if_impl.rs | |
parent | 5dab336049dbc6817e9ff212998690f59f6bbfa8 (diff) |
* Add an inbox/ outbox system to server components
* Define a data flow from Request -> computation -> Update
* Create simple handlers to call server or client code for requests
Diffstat (limited to 'games/rstnode/rst-client/src/state/if_impl.rs')
-rw-r--r-- | games/rstnode/rst-client/src/state/if_impl.rs | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/games/rstnode/rst-client/src/state/if_impl.rs b/games/rstnode/rst-client/src/state/if_impl.rs new file mode 100644 index 000000000000..38bac369d3cc --- /dev/null +++ b/games/rstnode/rst-client/src/state/if_impl.rs @@ -0,0 +1,70 @@ +#![allow(unused)] + +use super::ClientState; +use async_trait::async_trait; +use chrono::{DateTime, Utc}; +use rst_core::{ + wire::{ + game::Action, AuthErr, Lobby, LobbyErr, LobbyId, LobbyUpdate, MatchErr, MatchId, RegErr, + UpdateState, User, UserId, + }, + GameIf, Match, +}; +use std::sync::Arc; + +#[async_trait] +impl GameIf for ClientState { + async fn register(self: Arc<Self>, name: String, pw: String) -> Result<UserId, RegErr> { + todo!() + } + + async fn login(self: Arc<Self>, name: String, pw: String) -> Result<User, AuthErr> { + todo!() + } + + async fn logout(self: Arc<Self>, user: User) -> Result<(), AuthErr> { + todo!() + } + + async fn anonymous(self: Arc<Self>, name: String) -> Result<User, AuthErr> { + todo!() + } + + async fn join(self: Arc<Self>, user: User, lobby: LobbyId) -> Result<Lobby, LobbyErr> { + todo!() + } + + async fn leave(self: Arc<Self>, user: User, lobby: LobbyId) -> Result<(), LobbyErr> { + todo!() + } + + async fn ready( + self: Arc<Self>, + user: User, + lobby: LobbyId, + ready: bool, + ) -> Result<LobbyUpdate, LobbyErr> { + todo!() + } + + async fn start_req( + self: Arc<Self>, + user: UserId, + lobby: LobbyId, + ) -> Result<DateTime<Utc>, LobbyErr> { + todo!() + } + + async fn perform_action( + self: Arc<Self>, + user: User, + mtch: MatchId, + act: Action, + ) -> UpdateState { + todo!() + } + + async fn leave_match(self: Arc<Self>, user: User, mtch: MatchId) -> Result<(), MatchErr> { + todo!() + } +} |