cube_engine/client/mod.rs
1/*
2 * cube-engine
3 *
4 * Copyright (C) 2019 SOFe
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published
8 * by the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20mod handler;
21
22pub enum ClientState {
23 Initial,
24 LoginRequested,
25 Loading,
26 Spawned,
27 Disconnected,
28}
29
30pub struct Client<A> {
31 state: ClientState,
32 adapter: A,
33}
34
35impl<A: ClientAdapter> Client<A> {
36 pub fn new(adapter: A) -> Client<A> {
37 Client {
38 state: ClientState::Initial,
39 adapter,
40 }
41 }
42}
43
44pub trait ClientAdapter {}