Skip to main content

manabrew_protocol/prompts/
choose_board_targets.rs

1use serde::{Deserialize, Serialize};
2use ts_rs::TS;
3
4use crate::game::TargetingIntent;
5use crate::prompts::common::{PromptPresentation, TargetRef};
6
7#[derive(Debug, Clone, Serialize, Deserialize, TS)]
8#[serde(rename_all = "camelCase")]
9#[ts(export, export_to = "prompts/chooseBoardTargets.ts")]
10pub struct ChooseBoardTargetsInput {
11    pub presentation: PromptPresentation,
12    pub candidates: Vec<TargetRef>,
13    #[serde(default)]
14    pub hostile: bool,
15    pub intent: TargetingIntent,
16    pub min_targets: i32,
17    pub max_targets: i32,
18    pub chosen_targets: i32,
19    pub cancellable: bool,
20}
21
22#[derive(Debug, Clone, Serialize, Deserialize, TS)]
23#[serde(
24    tag = "type",
25    rename_all = "camelCase",
26    rename_all_fields = "camelCase"
27)]
28#[ts(export, export_to = "prompts/chooseBoardTargets.ts")]
29pub enum ChooseBoardTargetsOutput {
30    BoardTargets { chosen: Vec<TargetRef> },
31    Cancel,
32}