add player

This commit is contained in:
shenjack 2024-05-04 17:28:19 +08:00
parent 1f3adea7b0
commit cc53c21069
Signed by: shenjack
GPG Key ID: 7B1134A979775551
2 changed files with 27 additions and 1 deletions

View File

@ -1,5 +1,6 @@
mod engine;
/// 万里长征, 始于足下 /// 万里长征, 始于足下
mod player;
mod engine;
mod name; mod name;
mod rc4; mod rc4;

View File

@ -0,0 +1,25 @@
pub struct Player {
pub team: String,
pub name: String,
pub weapon: String,
pub player_type: PlayerType,
}
#[derive(Default)]
pub enum PlayerType {
#[default]
Normal,
Seed
}
impl Player {
pub fn new(team: String, name: String, weapon: String, player_type: Option<PlayerType>) -> Self {
Player {
team,
name,
weapon,
player_type: player_type.unwrap_or_default(),
}
}
}