-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[workspace] | ||
members = [ | ||
"./server", | ||
"./game", | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
use serde::Deserialize; | ||
|
||
use crate::remotes::RemoteInput; | ||
|
||
#[derive(Deserialize)] | ||
#[serde(untagged)] | ||
pub enum MessageToGame { | ||
Input(Input), | ||
RemoteInput(RemoteInput), | ||
RoomId(String), | ||
PlayerDirection(f64), | ||
} | ||
|
||
#[derive(Deserialize)] | ||
pub enum Input { | ||
A, | ||
B, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
pub mod controllers; | ||
pub mod game; | ||
pub mod players_connector; | ||
pub mod remote_communicator; | ||
pub mod remotes; | ||
pub mod room_code; | ||
pub mod server_communicator; | ||
pub mod signal; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use serde::Deserialize; | ||
|
||
#[derive(Deserialize)] | ||
#[serde(untagged)] | ||
|
||
pub enum RemoteInput { | ||
GameInput(GameInput), | ||
ReadyToPlay, | ||
SetUsername(String), | ||
} | ||
|
||
#[derive(Deserialize)] | ||
#[serde(rename_all = "kebab-case")] | ||
pub enum GameInput { | ||
Aim(f64), | ||
Shoot(f64), | ||
Bomb, | ||
Stop, | ||
Move(f64), | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mod messages; | ||
|
||
pub use messages::*; |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.