From 6f0c4577b1e4ab6871bd14827290623d2f01fc96 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 16 Mar 2021 11:48:19 +0000 Subject: [PATCH] hidden: make PriOccultedGeneral Signed-off-by: Ian Jackson --- daemon/api.rs | 2 +- src/pcrender.rs | 8 +++++--- src/prelude.rs | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/daemon/api.rs b/daemon/api.rs index 2ec54f89..1e03cd55 100644 --- a/daemon/api.rs +++ b/daemon/api.rs @@ -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), diff --git a/src/pcrender.rs b/src/pcrender.rs index d4377d3a..21542d6e 100644 --- a/src/pcrender.rs +++ b/src/pcrender.rs @@ -18,12 +18,14 @@ pub struct PieceRenderInstructions { } #[derive(Debug,Clone)] -pub enum PriOcculted { +pub enum PriOccultedGeneral { Visible(ShowUnocculted), Occulted, - Displaced(Pos, ZLevel), + Displaced(P, Z), } +pub type PriOcculted = PriOccultedGeneral; + impl VisiblePieceAngle { pub fn to_transform(self) -> VisibleAngleTransform { VisibleAngleTransform(base_misc::raw_angle_transform( @@ -46,7 +48,7 @@ impl PieceRenderInstructions { ) -> Option> { use PieceUpdateOp::*; - use PriOcculted::*; + use PriOG::*; if matches_doesnot!( op, = Move(_) | SetZLevel(_), diff --git a/src/prelude.rs b/src/prelude.rs index 71722f7d..e6663fdd 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -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; -- 2.30.2