Neo-Poseidon/game/player.rs

54 lines
1.0 KiB
Rust
Raw Normal View History

2019-05-09 00:13:15 +02:00
#[derive(Debug)]
2019-05-08 01:36:04 +02:00
enum Race {
Griffin,
Catte
}
impl Default for Race {
fn default() -> Self {
Race::Catte
}
}
2019-05-09 00:13:15 +02:00
#[derive(Debug)]
2019-05-08 01:36:04 +02:00
struct ResearchItem {
levels: u8,
points: u16
}
impl Default for ResearchItem {
fn default() -> Self {
ResearchItem{
levels: 1,
points: 0
}
}
}
2019-05-09 00:13:15 +02:00
#[derive(Default,Debug)]
2019-05-08 01:36:04 +02:00
struct Research {
weapons: ResearchItem,
banking: ResearchItem,
manufactoring: ResearchItem,
terraforming: ResearchItem,
hyperspace: ResearchItem,
experimentation: ResearchItem,
scanning: ResearchItem
}
2019-05-09 00:13:15 +02:00
#[derive(Debug)]
2019-05-08 01:36:04 +02:00
pub struct Player {
2019-05-09 00:13:15 +02:00
pub name: String,
2019-05-08 01:36:04 +02:00
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()
}
}
}