add player
This commit is contained in:
parent
1f3adea7b0
commit
cc53c21069
@ -1,5 +1,6 @@
|
|||||||
mod engine;
|
|
||||||
/// 万里长征, 始于足下
|
/// 万里长征, 始于足下
|
||||||
|
mod player;
|
||||||
|
mod engine;
|
||||||
mod name;
|
mod name;
|
||||||
mod rc4;
|
mod rc4;
|
||||||
|
|
||||||
|
25
namerena-runner/src/player.rs
Normal file
25
namerena-runner/src/player.rs
Normal 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(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user