Neo-Poseidon/game/mod.rs

21 lines
448 B
Rust
Raw Permalink Normal View History

2019-05-09 01:16:43 +02:00
pub mod player;
2019-05-08 01:36:04 +02:00
mod star;
mod carrier;
2019-05-09 00:13:15 +02:00
use self::player::Player;
use self::star::Star;
use self::carrier::Carrier;
2019-05-08 01:36:04 +02:00
2019-05-09 00:13:15 +02:00
#[derive(Default,Debug)]
pub struct Game {
2019-05-08 01:36:04 +02:00
players: Vec<Player>,
stars: Vec<Star>,
carriers: Vec<Carrier>
2019-05-09 00:13:15 +02:00
}
impl Game {
2019-05-09 01:16:43 +02:00
pub fn addPlayer(&mut self, name: String, color: Option<(u8,u8,u8)>, race: Option<player::Race>) {
let player = Player::new(name, color, race);
2019-05-09 00:13:15 +02:00
self.players.push(player);
}
2019-05-08 01:36:04 +02:00
}