mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-25 12:25:10 -08:00
just reorged some code
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user