}
}
-type FacesSpec = IndexVec<FaceId,ColourSpec>;
-
trait SimplePieceSpec {
fn outline(&self) -> Result<Box<dyn Outline>, SpecError>;
fn path(&self) -> Result<Html, SpecError>;
- fn faces(&self) -> Result<&FacesSpec, SpecError>;
+ fn faces(&self) -> Result<&FaceColourSpecs, SpecError>;
fn desc(&self) -> Result<Html, SpecError>;
fn itemname(&self) -> Result<String, SpecError>;
#[throws(SpecError)] fn path(&self) -> Html {
svg_circle_path(self.diam as f64)?
}
- #[throws(SpecError)] fn faces(&self) -> &FacesSpec { &self.faces }
+ #[throws(SpecError)] fn faces(&self) -> &FaceColourSpecs { &self.faces }
#[throws(SpecError)] fn desc(&self) -> Html { Html::lit("disc") }
#[throws(SpecError)] fn itemname(&self) -> String {
self.itemname.clone()
#[throws(SpecError)] fn path(&self) -> Html {
svg_rectangle_path(self.xy()?.promote())?
}
- #[throws(SpecError)] fn faces(&self) -> &FacesSpec { &self.faces }
+ #[throws(SpecError)] fn faces(&self) -> &FaceColourSpecs { &self.faces }
#[throws(SpecError)] fn desc(&self) -> Html { Html::lit("square") }
#[throws(SpecError)] fn itemname(&self) -> String {
self.itemname.clone()
pub mod piece_specs {
use super::*;
+ pub type FaceColourSpecs = IndexVec<FaceId,ColourSpec>;
+
#[derive(Debug,Serialize,Deserialize)]
pub struct Disc {
pub itemname: Option<String>,