team04_server/messages/
placement_complete.rs1use crate::{board::Coord, unit::UnitType};
2
3use super::*;
4
5#[derive(Deserialize, Debug)]
6pub struct PlacedUnit {
7 pub unit: UnitType,
8 pub(crate) position: [usize; 2],
9}
10
11impl PlacedUnit {
12 pub fn coord(&self) -> Coord {
13 Coord {
14 x: self.position[0],
15 y: self.position[1],
16 }
17 }
18}
19
20#[derive(Deserialize, Debug)]
21#[serde(rename_all = "camelCase")]
22pub struct PlacementComplete {
23 pub unit_placement: Vec<PlacedUnit>,
24 pub unit_bank: Vec<UnitType>,
25}