chiark / gitweb /
hidden: make PriOccultedGeneral
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 16 Mar 2021 11:48:19 +0000 (11:48 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 16 Mar 2021 11:48:19 +0000 (11:48 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
daemon/api.rs
src/pcrender.rs
src/prelude.rs

index 2ec54f895586c9b3684a8d49a4fb283fecd1d5dd..1e03cd55be12aaf0823997431114b0c2c5be6f65 100644 (file)
@@ -475,7 +475,7 @@ api_route!{
                           ipc)
         .ok_or(OE::PieceGone)?;
       let y = {
-        use PriOcculted::*;
+        use PriOG::*;
         match pri.occulted {
           Visible(y) => y,
           Occulted | Displaced(..) => throw!(OE::BadOperation),
index d4377d3a487647579a92b95e7d6a16f5880bb8ac..21542d6e0806e14f363efab9a1389b49d568a985 100644 (file)
@@ -18,12 +18,14 @@ pub struct PieceRenderInstructions {
 }
 
 #[derive(Debug,Clone)]
-pub enum PriOcculted {
+pub enum PriOccultedGeneral<P,Z> {
   Visible(ShowUnocculted),
   Occulted,
-  Displaced(Pos, ZLevel),
+  Displaced(P, Z),
 }
 
+pub type PriOcculted = PriOccultedGeneral<Pos, ZLevel>;
+
 impl VisiblePieceAngle {
   pub fn to_transform(self) -> VisibleAngleTransform {
     VisibleAngleTransform(base_misc::raw_angle_transform(
@@ -46,7 +48,7 @@ impl PieceRenderInstructions {
   ) -> Option<PieceUpdateOp<PreparedPieceState, ZLevel>>
   {
     use PieceUpdateOp::*;
-    use PriOcculted::*;
+    use PriOG::*;
     if matches_doesnot!(
       op,
       = Move(_) | SetZLevel(_),
index 71722f7daf9936cc06c5042a32df07262fbd11fb..e6663fdd0edb6f8c8109497f5fde3aef6aa37cbb 100644 (file)
@@ -167,6 +167,9 @@ pub type SpE = SpecError;
 pub type OccK = OccultationKind;
 pub use OccultationKindGeneral as OccKG;
 
+// pcrender.rs
+pub use PriOccultedGeneral as PriOG;
+
 // updates.rs
 pub type PUE = PreparedUpdateEntry;
 pub type PUFOS = PieceUpdateFromOpSimple;