You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 regels
431 B

  1. use std::ops::{Deref, DerefMut};
  2. use glc::vector::Vector2f;
  3. use specs::{Component, VecStorage};
  4. pub struct Velocity(pub Vector2f);
  5. impl Component for Velocity {
  6. type Storage = VecStorage<Self>;
  7. }
  8. impl Deref for Velocity {
  9. type Target = Vector2f;
  10. fn deref(&self) -> &Self::Target {
  11. &self.0
  12. }
  13. }
  14. impl DerefMut for Velocity {
  15. fn deref_mut(&mut self) -> &mut Self::Target {
  16. &mut self.0
  17. }
  18. }