use crate::internal::*;
use crate::prelude::*;
pub mod generator;
pub mod types;
#[derive(Clone, PartialEq, PartialOrd, Debug, Default, Serialize, Deserialize)]
pub struct GalacticHex {
pub index: SpaceCoordinates,
pub neighborhood: StellarNeighborhood,
pub contents: Vec<StarSystem>,
}
impl GalacticHex {
pub fn new(
index: SpaceCoordinates,
neighborhood: StellarNeighborhood,
contents: Vec<StarSystem>,
) -> Self {
Self {
index,
neighborhood,
contents,
}
}
}
impl Display for GalacticHex {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"Hex {} in {} containing {} star systems",
self.index,
self.neighborhood,
self.contents.len(),
)
}
}