|
|
@ -15,7 +15,7 @@ pub enum AreaType { |
|
|
|
#[derive(Debug, Copy, Clone, PartialEq)]
|
|
|
|
pub struct LobbyId(pub usize);
|
|
|
|
|
|
|
|
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
|
|
|
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, derive_more::Display)]
|
|
|
|
pub struct RoomId(pub usize);
|
|
|
|
|
|
|
|
impl LobbyId {
|
|
|
@ -26,7 +26,7 @@ impl LobbyId { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
|
#[error("")]
|
|
|
|
#[error("create room")]
|
|
|
|
pub enum CreateRoomError {
|
|
|
|
NoOpenSlots,
|
|
|
|
ClientInAreaAlready,
|
|
|
@ -34,7 +34,7 @@ pub enum CreateRoomError { |
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
|
#[error("")]
|
|
|
|
#[error("join room")]
|
|
|
|
pub enum JoinRoomError {
|
|
|
|
RoomDoesNotExist,
|
|
|
|
RoomFull,
|
|
|
@ -42,7 +42,7 @@ pub enum JoinRoomError { |
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
|
#[error("")]
|
|
|
|
#[error("join lobby")]
|
|
|
|
pub enum JoinLobbyError {
|
|
|
|
LobbyDoesNotExist,
|
|
|
|
LobbyFull,
|
|
|
@ -50,7 +50,7 @@ pub enum JoinLobbyError { |
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
|
#[error("")]
|
|
|
|
#[error("get area")]
|
|
|
|
pub enum GetAreaError {
|
|
|
|
NotInRoom,
|
|
|
|
NotInLobby,
|
|
|
@ -58,28 +58,28 @@ pub enum GetAreaError { |
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
|
#[error("")]
|
|
|
|
#[error("client removal")]
|
|
|
|
pub enum ClientRemovalError {
|
|
|
|
ClientNotInArea,
|
|
|
|
InvalidArea,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
|
#[error("")]
|
|
|
|
#[error("get clients")]
|
|
|
|
pub enum GetClientsError {
|
|
|
|
InvalidClient,
|
|
|
|
InvalidArea,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
|
#[error("")]
|
|
|
|
#[error("get neighbor")]
|
|
|
|
pub enum GetNeighborError {
|
|
|
|
InvalidClient,
|
|
|
|
InvalidArea,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
|
#[error("")]
|
|
|
|
#[error("get leader")]
|
|
|
|
pub enum GetLeaderError {
|
|
|
|
InvalidClient,
|
|
|
|
InvalidArea,
|
|
|
@ -87,7 +87,7 @@ pub enum GetLeaderError { |
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Error, Debug, PartialEq)]
|
|
|
|
#[error("")]
|
|
|
|
#[error("clientlocation")]
|
|
|
|
pub enum ClientLocationError {
|
|
|
|
CreateRoomError(#[from] CreateRoomError),
|
|
|
|
JoinRoomError(#[from] JoinRoomError),
|
|
|
|