Skip to main content

cardinal_kernel/model/
command.rs

1use crate::ids::{CardId, PlayerId, ZoneId};
2
3#[derive(Debug, Clone)]
4pub enum Command {
5    MoveCard { card: CardId, from: ZoneId, to: ZoneId },
6    ChangeLife { player: PlayerId, delta: i32 },
7    PushStack { item: StackItem },
8    RequestChoice { player: PlayerId, choice: PendingChoice },
9}
10
11#[derive(Debug, Clone)]
12pub struct StackItem {
13    pub id: u32,
14    pub source: Option<CardId>,
15    pub controller: PlayerId,
16    pub effect: EffectRef,
17}
18
19#[derive(Debug, Clone)]
20pub enum EffectRef {
21    Builtin(&'static str),
22    Scripted(String), // mod-defined
23}
24
25#[derive(Debug, Clone)]
26pub struct PendingChoice {
27    pub id: u32,
28    pub prompt: String,
29    pub kind: ChoiceKind,
30}
31
32#[derive(Debug, Clone)]
33pub enum ChoiceKind {
34    ChooseTarget { allowed: AllowedTargets },
35}
36
37#[derive(Debug, Clone)]
38pub enum AllowedTargets {
39    AnyCreatureOnField,
40    AnyPlayer,
41    // etc
42}