use titan::Message; use crate::commands::{LogicClaimRewardCommand, LogicCommand}; #[derive(Debug, Message)] #[message( id = 24111, direction = "server", name = "AvailableServerCommandMessage" )] pub struct AvailableServerCommandMessage { pub command: Box, } 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()) } }