From fa205303a3ae4dca0ee6c7bd8de94949e180ba75 Mon Sep 17 00:00:00 2001 From: troido Date: Mon, 3 Feb 2020 17:12:13 +0100 Subject: now also send playerpos messages --- src/components.rs | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'src/components.rs') diff --git a/src/components.rs b/src/components.rs index 1613b7f..3b17f0c 100644 --- a/src/components.rs +++ b/src/components.rs @@ -1,45 +1,10 @@ -use std::ops; - use specs::{ DenseVecStorage, Component }; use super::controls::Control; -use super::util::clamp; - - -#[derive(Component, Debug, Hash, PartialEq, Eq, Clone, Copy)] -pub struct Pos { - pub x: i32, - pub y: i32 -} - -impl ops::Add for Pos { - type Output = Pos; - - fn add(self, other: Pos) -> Pos { - Pos { - x: self.x + other.x, - y: self.y + other.y - } - } -} - -impl Pos { - - pub fn new(x: i32, y: i32) -> Pos { - Pos {x, y} - } - - pub fn clamp(self, smaller: Pos, larger: Pos) -> Pos { - Pos { - x: clamp(self.x, smaller.x, larger.x), - y: clamp(self.y, smaller.y, larger.y) - } - } -} #[derive(Component, Debug, Clone)] pub struct Visible { -- cgit