54 lines
1.0 KiB
Rust
54 lines
1.0 KiB
Rust
#[derive(Debug)]
|
|
enum Race {
|
|
Griffin,
|
|
Catte
|
|
}
|
|
impl Default for Race {
|
|
fn default() -> Self {
|
|
Race::Catte
|
|
}
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
struct ResearchItem {
|
|
levels: u8,
|
|
points: u16
|
|
}
|
|
impl Default for ResearchItem {
|
|
fn default() -> Self {
|
|
ResearchItem{
|
|
levels: 1,
|
|
points: 0
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Default,Debug)]
|
|
struct Research {
|
|
weapons: ResearchItem,
|
|
banking: ResearchItem,
|
|
manufactoring: ResearchItem,
|
|
terraforming: ResearchItem,
|
|
hyperspace: ResearchItem,
|
|
experimentation: ResearchItem,
|
|
scanning: ResearchItem
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct Player {
|
|
pub name: String,
|
|
color: (u8, u8, u8),
|
|
race: Race,
|
|
research: Research
|
|
}
|
|
impl Default for Player {
|
|
fn default() -> Self {
|
|
Player{
|
|
name: String::default(),
|
|
//Color: (rand::thread_rng().gen(), rand::thread_rng().gen(), rand::thread_rng().gen()),
|
|
color: (0,0,0),
|
|
race: Race::default(),
|
|
research: Research::default()
|
|
}
|
|
}
|
|
} |