Skip to main content

manabrew_protocol/prompts/
pay_mana_cost.rs

1use serde::{Deserialize, Serialize};
2use ts_rs::TS;
3
4use crate::prompts::common::AvailableAction;
5
6#[derive(Debug, Clone, Serialize, Deserialize, TS)]
7#[serde(rename_all = "camelCase")]
8#[ts(export, export_to = "prompts/payManaCost.ts")]
9pub struct PayManaCostInput {
10    pub card_id: String,
11    pub card_name: String,
12    pub mana_cost: String,
13    pub can_confirm_from_pool: bool,
14    pub actions: Vec<AvailableAction>,
15    #[serde(default, skip_serializing_if = "Option::is_none")]
16    #[ts(optional)]
17    pub description: Option<String>,
18}
19
20#[derive(Debug, Clone, Serialize, Deserialize, TS)]
21#[serde(
22    tag = "type",
23    rename_all = "camelCase",
24    rename_all_fields = "camelCase"
25)]
26#[ts(export, export_to = "prompts/payManaCost.ts")]
27pub enum PayManaCostOutput {
28    Act {
29        action_id: String,
30    },
31    Pay {
32        #[serde(default)]
33        auto: bool,
34    },
35    PayLife,
36    Cancel,
37}