chiark / gitweb /
hidden: Provide Occultation::in_region()
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 12 Feb 2021 00:54:46 +0000 (00:54 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 12 Feb 2021 01:38:24 +0000 (01:38 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/hidden.rs

index 476a048ab1fe8e7620b84246c0ef87404bf28110..e4833c791509070b8a0ed15cad8b9fabbadbaa9c 100644 (file)
@@ -92,6 +92,10 @@ impl Occultation {
     );
     kind
   }
+
+  pub fn in_region(&self, pos: Pos) -> bool {
+    self.region.contains(pos)
+  }
 }
 
 impl GameOccults {