df_st_core/df_world/
river.rs1use crate::create_new::CreateNew;
2use crate::fillable::{Fillable, Filler};
3use crate::positions::{Coordinate, Path};
4use crate::SchemaExample;
5use df_st_derive::{Fillable, Filler, HashAndPartialEqById};
6use juniper::GraphQLObject;
7use schemars::JsonSchema;
8use serde::{Deserialize, Serialize};
9
10#[derive(
12 Serialize,
13 Deserialize,
14 Clone,
15 Debug,
16 HashAndPartialEqById,
17 Fillable,
18 Filler,
19 Default,
20 JsonSchema,
21 GraphQLObject,
22)]
23pub struct River {
24 pub id: i32,
28 pub name: Option<String>,
30 pub path: Vec<Path>,
33 pub end_pos: Option<Coordinate>,
36}
37
38impl CreateNew for River {
39 fn new_by_id(id: i32) -> Self {
40 Self {
41 id,
42 ..Default::default()
43 }
44 }
45}
46
47impl SchemaExample for River {
48 fn example() -> Self {
49 Self::default()
50 }
51}