wip 2 pointifying
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user