pub use crate::mgmtchannel::*;
pub use crate::occultilks::*;
pub use crate::organise;
+pub use crate::outline::*;
pub use crate::pcaliases::*;
pub use crate::pcrender::*;
pub use crate::pieces::*;
--- /dev/null
+// Copyright 2020-2021 Ian Jackson and contributors to Otter
+// SPDX-License-Identifier: AGPL-3.0-or-later
+// There is NO WARRANTY.
+
+// Copyright 2020-2021 Ian Jackson and contributors to Otter
+// SPDX-License-Identifier: AGPL-3.0-or-later
+// There is NO WARRANTY.
+
+use crate::prelude::*;
+
+//================ principal definitions of both shapes ================
+
+macro_rules! shape_defns { {
+ $( $Shape:ident $serde:literal ;)*
+} => { paste!{
+
+
+ $( use crate::shapelib::[< $Shape Outline >]; )*
+
+ #[dyn_upcast(OutlineTrait)]
+ #[enum_dispatch(OutlineTrait)]
+ #[derive(Clone,Debug,Serialize,Deserialize)]
+ #[serde(tag="type")]
+ pub enum Outline { $(
+ #[serde(rename=$serde)] [< $Shape Outline >],
+ )* }
+
+
+ #[derive(Deserialize,Debug,Copy,Clone,Eq,PartialEq)]
+ pub enum Shape { $(
+ #[serde(rename=$serde)] [< $Shape >],
+ )* }
+
+
+ $(
+ #[derive(Deserialize,Debug)]
+ pub struct [< $Shape ShapeIndicator >];
+ )*
+
+
+ impl Shape {
+ pub fn shapelib_loadable(self)
+ -> &'static dyn shapelib::ShapeLoadableTrait
+ {
+ match self { $(
+ Self::$Shape => &[< $Shape ShapeIndicator >] as _,
+ )* }
+ }
+ }
+
+} } }
+
+shape_defns! {
+ Circle "Circle";
+ Rect "Rect" ;
+}
// game specs
use crate::crates::*;
+use crate::outline::*;
use otter_support::crates::*;
use otter_base::crates::*;
pub item: String,
}
-mod outline {
- use crate::prelude::*;
-
- macro_rules! shape_defns { {
- $( $Shape:ident $serde:literal ;)*
- } => { paste!{
- $( use crate::shapelib::[< $Shape Outline >]; )*
-
- #[dyn_upcast(OutlineTrait)]
- #[enum_dispatch(OutlineTrait)]
- #[derive(Clone,Debug,Serialize,Deserialize)]
- #[serde(tag="type")]
- pub enum Outline { $(
- #[serde(rename=$serde)] [< $Shape Outline >],
- )* }
-
- #[derive(Deserialize,Debug,Copy,Clone,Eq,PartialEq)]
- pub enum Shape { $(
- #[serde(rename=$serde)] [< $Shape >],
- )* }
-
- $(
- #[derive(Deserialize,Debug)]
- pub struct [< $Shape ShapeIndicator >];
- )*
-
- impl Shape {
- pub fn shapelib_loadable(self)
- -> &'static dyn shapelib::ShapeLoadableTrait
- {
- match self { $(
- Self::$Shape => &[< $Shape ShapeIndicator >] as _,
- )* }
- }
- }
-
- } } }
-
- shape_defns! {
- Circle "Circle";
- Rect "Rect" ;
- }
-}
-pub use outline::*;
-
pub mod piece_specs {
use super::*;