23 lines
617 B
Rust
23 lines
617 B
Rust
use titan::Message;
|
|
use crate::commands::{LogicClaimRewardCommand, LogicCommand};
|
|
#[derive(Debug, Message)]
|
|
#[message(
|
|
id = 24111,
|
|
direction = "server",
|
|
name = "AvailableServerCommandMessage"
|
|
)]
|
|
pub struct AvailableServerCommandMessage {
|
|
pub command: Box<dyn LogicCommand>,
|
|
}
|
|
impl AvailableServerCommandMessage {
|
|
pub fn claim_reward(command: LogicClaimRewardCommand) -> Self {
|
|
Self {
|
|
command: Box::new(command),
|
|
}
|
|
}
|
|
}
|
|
impl Default for AvailableServerCommandMessage {
|
|
fn default() -> Self {
|
|
Self::claim_reward(LogicClaimRewardCommand::default())
|
|
}
|
|
}
|