21 lines
448 B
Rust
21 lines
448 B
Rust
pub mod player;
|
|
mod star;
|
|
mod carrier;
|
|
|
|
use self::player::Player;
|
|
use self::star::Star;
|
|
use self::carrier::Carrier;
|
|
|
|
#[derive(Default,Debug)]
|
|
pub struct Game {
|
|
players: Vec<Player>,
|
|
stars: Vec<Star>,
|
|
carriers: Vec<Carrier>
|
|
}
|
|
|
|
impl Game {
|
|
pub fn addPlayer(&mut self, name: String, color: Option<(u8,u8,u8)>, race: Option<player::Race>) {
|
|
let player = Player::new(name, color, race);
|
|
self.players.push(player);
|
|
}
|
|
} |