2019-05-08 01:36:04 +02:00
|
|
|
mod player;
|
|
|
|
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 {
|
|
|
|
pub fn addPlayer(&mut self, name: String) {
|
|
|
|
let mut player: Player = Player::default();
|
|
|
|
player.name = name;
|
|
|
|
self.players.push(player);
|
|
|
|
}
|
2019-05-08 01:36:04 +02:00
|
|
|
}
|