player object
This commit is contained in:
@@ -4,7 +4,7 @@ use crate::layer::Layer;
|
||||
use crate::log::LogLine;
|
||||
use crate::object_def::ObjectDef;
|
||||
use crate::utils::Direction;
|
||||
use crate::utils::{Behavior, ObjectId, Player, PortalDef, Pushable, RegistryValue, Solid};
|
||||
use crate::utils::{Behavior, ObjectId, PlayerPos, PortalDef, Pushable, RegistryValue, Solid};
|
||||
use std::collections::{BTreeMap, HashMap, HashSet};
|
||||
|
||||
/// The complete state of one game board (a single room or screen).
|
||||
@@ -44,7 +44,7 @@ pub struct Board {
|
||||
/// cell with [`Board::get`]/[`Board::get_mut`] by `(z, x, y)`.
|
||||
pub(crate) layers: Vec<Layer>,
|
||||
/// Current player position. See [`Player`] for caveats about its future.
|
||||
pub player: Player,
|
||||
pub player: PlayerPos,
|
||||
/// Scripted objects on this board, keyed by stable [`ObjectId`]. A `BTreeMap`
|
||||
/// (not a `Vec`) so an object can be removed without invalidating other
|
||||
/// objects' ids; iteration is in ascending-id order, which equals load order
|
||||
@@ -623,7 +623,7 @@ pub(crate) mod tests {
|
||||
use crate::layer::Layer;
|
||||
use crate::object_def::ObjectDef;
|
||||
use crate::utils::Direction;
|
||||
use crate::utils::{ObjectId, Player};
|
||||
use crate::utils::{ObjectId, PlayerPos};
|
||||
use color::Rgba8;
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
|
||||
@@ -653,7 +653,7 @@ pub(crate) mod tests {
|
||||
layers: vec![Layer {
|
||||
cells: vec![(Glyph::transparent(), Archetype::Empty); w * h],
|
||||
}],
|
||||
player: Player {
|
||||
player: PlayerPos {
|
||||
x: player.0,
|
||||
y: player.1,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user