-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
817 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ members = [ | |
"battle_server", | ||
"battle_gui", | ||
"battle_tools", | ||
"examples", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
pub mod audio; | ||
pub mod debug; | ||
pub mod engine; | ||
pub mod error; | ||
pub mod graphics; | ||
pub mod physics; | ||
pub mod run; | ||
pub mod saves; | ||
pub mod server; | ||
pub mod ui; | ||
pub mod utils; | ||
|
||
use battle_core::deployment::DeploymentReaderError; | ||
use battle_core::map::reader::MapReaderError; | ||
use battle_core::message::InputMessage; | ||
use battle_core::network::error::NetworkError; | ||
use battle_core::state::battle::builder::BattleStateBuilderError; | ||
|
||
use crossbeam_channel::SendError; | ||
use ggez::GameError; | ||
use oc_core::resources::ResourcesError; | ||
use server::EmbeddedServerError; | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Debug)] | ||
pub enum GuiError { | ||
#[error("Resource load error : {0}")] | ||
Resources(ResourcesError), | ||
#[error("Deployment load error : {0}")] | ||
Deployment(DeploymentReaderError), | ||
#[error("Error during map load : {0}")] | ||
MapReader(MapReaderError), | ||
#[error("Running error : {0}")] | ||
RunGame(GameError), | ||
#[error("Error during input send : {0}")] | ||
SendInput(SendError<Vec<InputMessage>>), | ||
#[error("Network error : {0}")] | ||
Network(NetworkError), | ||
#[error("Embedded server error : {0}")] | ||
EmbeddedServer(EmbeddedServerError), | ||
#[error("Battle state builder error : {0}")] | ||
BattleStateBuilderError(BattleStateBuilderError), | ||
} | ||
|
||
impl From<MapReaderError> for GuiError { | ||
fn from(error: MapReaderError) -> Self { | ||
Self::MapReader(error) | ||
} | ||
} | ||
|
||
impl From<GameError> for GuiError { | ||
fn from(error: GameError) -> Self { | ||
Self::RunGame(error) | ||
} | ||
} | ||
|
||
impl From<SendError<Vec<InputMessage>>> for GuiError { | ||
fn from(error: SendError<Vec<InputMessage>>) -> Self { | ||
Self::SendInput(error) | ||
} | ||
} | ||
|
||
impl From<NetworkError> for GuiError { | ||
fn from(error: NetworkError) -> Self { | ||
Self::Network(error) | ||
} | ||
} | ||
|
||
impl From<EmbeddedServerError> for GuiError { | ||
fn from(error: EmbeddedServerError) -> Self { | ||
Self::EmbeddedServer(error) | ||
} | ||
} | ||
|
||
impl From<ResourcesError> for GuiError { | ||
fn from(error: ResourcesError) -> Self { | ||
Self::Resources(error) | ||
} | ||
} | ||
|
||
impl From<DeploymentReaderError> for GuiError { | ||
fn from(error: DeploymentReaderError) -> Self { | ||
Self::Deployment(error) | ||
} | ||
} | ||
|
||
impl From<BattleStateBuilderError> for GuiError { | ||
fn from(error: BattleStateBuilderError) -> Self { | ||
Self::BattleStateBuilderError(error) | ||
} | ||
} |
Oops, something went wrong.