1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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!()
}
}
|