1use crate::pos::InteractionPoint;
2use either::Either;
3use serde::Deserialize;
4
5#[serde(rename_all = "camelCase")]
13#[derive(Deserialize, Clone, Default, Debug, Eq, PartialEq)]
14pub struct GiveResult {
15 str: Option<String>,
16 paren: Option<bool>,
17}
18
19impl GiveResult {
20 pub fn into_either(self) -> Either<String, bool> {
21 match (self.str, self.paren) {
22 (Some(s), None) => Either::Left(s),
23 (None, Some(b)) => Either::Right(b),
24 _ => unreachable!(),
25 }
26 }
27}
28
29#[serde(rename_all = "camelCase")]
30#[derive(Deserialize, Clone, Default, Debug, Eq, PartialEq)]
31pub struct GiveAction {
32 pub give_result: GiveResult,
33 pub interaction_point: InteractionPoint,
34}