|
- use serde::{Deserialize, Serialize};
- use specs::{Component, HashMapStorage};
-
- use crate::misc::FlaggedStorage;
-
- #[derive(Clone, Debug, Serialize, Deserialize)]
- pub struct Asteroid {
- type_: Type,
- }
-
- #[derive(Copy, Clone, Debug, Serialize, Deserialize)]
- pub enum Type {
- Metal,
- Crystal,
- }
-
- impl Asteroid {
- #[inline]
- pub fn new(type_: Type) -> Self {
- Self { type_ }
- }
-
- #[inline]
- pub fn type_(&self) -> Type {
- self.type_
- }
- }
-
- impl Component for Asteroid {
- type Storage = FlaggedStorage<Self, HashMapStorage<Self>>;
- }
|