Compare commits
No commits in common. "5e6d57ab71c3234f7cacd095e3e74ebfa8764e39" and "25518879d90aeb5c7b4bd52bb49cf4c2c772636d" have entirely different histories.
5e6d57ab71
...
25518879d9
|
@ -9,8 +9,8 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
- rustup component add clippy rustfmt
|
- rustup component add clippy rustfmt
|
||||||
- cargo fmt --check
|
- cargo fmt --check
|
||||||
- cargo test --all-features
|
- cargo test
|
||||||
- cargo clippy --all-features
|
- cargo clippy
|
||||||
- name: release
|
- name: release
|
||||||
image: rust
|
image: rust
|
||||||
pull: always
|
pull: always
|
||||||
|
|
|
@ -11,7 +11,6 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
serde = { version = "1", optional = true, features = ["derive"]}
|
|
||||||
|
|
||||||
[package.metadata.release]
|
[package.metadata.release]
|
||||||
publish = false
|
publish = false
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
//! Support function for 2D geometry
|
//! Support function for 2D geometry
|
||||||
//!
|
//!
|
||||||
|
|
||||||
#[cfg(feature = "serde")]
|
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
/// Position on the map
|
/// Position on the map
|
||||||
#[derive(Default, PartialEq, Copy, Clone, Debug, Eq, Hash)]
|
#[derive(Default, PartialEq, Copy, Clone, Debug, Eq, Hash)]
|
||||||
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
|
|
||||||
pub struct Point {
|
pub struct Point {
|
||||||
pub x: usize,
|
pub x: usize,
|
||||||
pub y: usize,
|
pub y: usize,
|
||||||
|
@ -33,7 +29,6 @@ impl Point {
|
||||||
|
|
||||||
/// Rectangle region on the map
|
/// Rectangle region on the map
|
||||||
#[derive(Hash, PartialEq, Eq, Copy, Clone, Debug)]
|
#[derive(Hash, PartialEq, Eq, Copy, Clone, Debug)]
|
||||||
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
|
|
||||||
pub struct Rect {
|
pub struct Rect {
|
||||||
pub x1: usize,
|
pub x1: usize,
|
||||||
pub x2: usize,
|
pub x2: usize,
|
||||||
|
|
|
@ -7,15 +7,10 @@
|
||||||
//! specific game.
|
//! specific game.
|
||||||
//!
|
//!
|
||||||
|
|
||||||
|
use super::geometry::{usize_abs, Point, Rect};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[cfg(feature = "serde")]
|
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
use crate::geometry::{usize_abs, Point, Rect};
|
|
||||||
|
|
||||||
#[derive(PartialEq, Copy, Clone, Debug, Eq, Hash)]
|
#[derive(PartialEq, Copy, Clone, Debug, Eq, Hash)]
|
||||||
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
|
|
||||||
pub struct Tile {
|
pub struct Tile {
|
||||||
is_blocked: bool,
|
is_blocked: bool,
|
||||||
index: usize,
|
index: usize,
|
||||||
|
@ -35,7 +30,6 @@ pub struct NoData;
|
||||||
|
|
||||||
/// Map data
|
/// Map data
|
||||||
#[derive(Default, Clone)]
|
#[derive(Default, Clone)]
|
||||||
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
|
|
||||||
pub struct Map<D: Clone + Default> {
|
pub struct Map<D: Clone + Default> {
|
||||||
pub tiles: Vec<Tile>,
|
pub tiles: Vec<Tile>,
|
||||||
pub width: usize,
|
pub width: usize,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user