Skip to main content

nil_payload/response/npc/
bot.rs

1// Copyright (C) Call of Nil contributors
2// SPDX-License-Identifier: AGPL-3.0-only
3
4use derive_more::{Deref, DerefMut, From, Into};
5use nil_core::continent::Coord;
6use nil_core::npc::bot::PublicBot;
7use serde::{Deserialize, Serialize};
8
9#[cfg(feature = "axum")]
10use nil_payload_macros::IntoJsonResponse;
11
12#[cfg(feature = "typescript")]
13use ts_rs::TS;
14
15#[derive(Clone, Debug, Deref, DerefMut, From, Into, Deserialize, Serialize)]
16#[cfg_attr(feature = "axum", derive(IntoJsonResponse))]
17#[cfg_attr(feature = "typescript", derive(TS))]
18#[cfg_attr(feature = "typescript", ts(export))]
19pub struct GetBotCoordsResponse(pub Vec<Coord>);
20
21#[derive(Clone, Debug, Deref, DerefMut, From, Into, Deserialize, Serialize)]
22#[cfg_attr(feature = "axum", derive(IntoJsonResponse))]
23#[cfg_attr(feature = "typescript", derive(TS))]
24#[cfg_attr(feature = "typescript", ts(export))]
25pub struct GetPublicBotResponse(pub PublicBot);
26
27#[derive(Clone, Debug, Deref, DerefMut, From, Into, Deserialize, Serialize)]
28#[cfg_attr(feature = "axum", derive(IntoJsonResponse))]
29#[cfg_attr(feature = "typescript", derive(TS))]
30#[cfg_attr(feature = "typescript", ts(export))]
31pub struct GetPublicBotsResponse(pub Vec<PublicBot>);