just reorged some code

This commit is contained in:
Christopher
2023-03-01 09:44:14 +13:00
parent bc4470999c
commit c23449fac3

View File

@@ -7,6 +7,21 @@ pub struct Galaxy {
pub enterprise: Enterprise
}
pub struct Quadrant {
pub stars: Vec<Pos>,
pub star_base: Option<Pos>,
pub klingons: Vec<Klingon>
}
pub struct Klingon {
pub sector: Pos
}
pub struct Enterprise {
pub quadrant: Pos,
pub sector: Pos,
}
#[derive(PartialEq, Clone, Copy, Debug)]
pub struct Pos(pub u8, pub u8);
@@ -54,21 +69,6 @@ pub enum SectorStatus {
Empty, Star, StarBase, Klingon
}
pub struct Quadrant {
pub stars: Vec<Pos>,
pub star_base: Option<Pos>,
pub klingons: Vec<Klingon>
}
pub struct Klingon {
pub sector: Pos
}
pub struct Enterprise {
pub quadrant: Pos,
pub sector: Pos,
}
impl Galaxy {
pub fn generate_new() -> Self {
let quadrants = Self::generate_quadrants();