scroll.server/logic/logic/src/commands/mod.rs
WiseDev 972c61dae7 replace command enum with a dyn trait + registry
new logic-derive Command macro submits each command to inventory, manager decodes by vint type. titan-derive loses tagged enums since nothing uses them now. rest of the diff is rustfmt.
2026-08-23 08:05:58 +03:00

47 lines
1.5 KiB
Rust

mod chest;
mod command;
mod header;
mod manager;
mod reward;
mod spells;
mod ui;
pub use chest::{
LogicClaimRewardCommand, LogicCollectFreeChestCommand, LogicCollectMultiWinChestCommand,
LogicStartRewardClaimCommand,
};
pub use command::{CommandMeta, CommandOutcome, CommandRegistryEntry, Execute, LogicCommand};
pub use header::LogicCommandHeader;
pub use manager::LogicCommandManager;
pub use reward::LogicReward;
pub use spells::{LogicFuseSpellsCommand, LogicSortCollectionCommand};
pub use ui::{
LogicHelpOpenedCommand, LogicPageOpenedCommand, LogicRefreshAchievementsCommand,
LogicShopOpenedCommand,
};
pub mod command_type {
pub const CLAIM_REWARD: i32 = 213;
pub const ADD_CHEST: i32 = 214;
pub const ADD_SPELLS: i32 = 216;
pub const SWAP_SPELLS: i32 = 500;
pub const START_EXPLORING: i32 = 502;
pub const START_REWARD_CLAIM: i32 = 503;
pub const FUSE_SPELLS: i32 = 504;
pub const SPEED_UP_EXPLORING: i32 = 506;
pub const SELL_CHEST: i32 = 507;
pub const UPDATE_LAST_SHOWN_LEVEL_UP: i32 = 516;
pub const CANCEL_CHEST_OPEN: i32 = 517;
pub const COLLECT_FREE_CHEST: i32 = 518;
pub const SORT_COLLECTION: i32 = 520;
pub const MOVE_SPELL: i32 = 521;
pub const COLLECT_MULTI_WIN_CHEST: i32 = 523;
pub const HELP_OPENED: i32 = 531;
pub const SHOP_OPENED: i32 = 532;
pub const REFRESH_ACHIEVEMENTS: i32 = 538;
pub const PAGE_OPENED: i32 = 539;
}
pub mod chest_source {
pub const SLOT: i32 = 1;
pub const FREE: i32 = 2;
pub const CROWN: i32 = 3;
pub const PURCHASED: i32 = 4;
}