wip 2 pointifying

This commit is contained in:
2026-08-11 01:02:38 -05:00
parent 3b5bf21ac5
commit 38c58a2c5f
25 changed files with 163 additions and 309 deletions
+3 -8
View File
@@ -1,5 +1,6 @@
use serde::{Deserialize, Serialize};
use crate::glyph::Glyph;
use crate::utils::Point;
/// A portal that teleports the player to a named entry point on another board.
///
@@ -16,8 +17,8 @@ use crate::glyph::Glyph;
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "lowercase")]
pub struct Portal {
pub x: usize,
pub y: usize,
#[serde(flatten)]
pub location: Point,
/// Board-unique name for this portal, also used as `target_entry` by portals
/// on other boards that want to arrive here.
pub name: String,
@@ -28,9 +29,3 @@ pub struct Portal {
#[serde(skip_serializing_if = "Option::is_none")]
pub glyph: Option<Glyph>
}
impl Portal {
pub fn location(&self) -> (usize, usize) {
(self.x, self.y)
}
}