Encapsulate player

This commit is contained in:
Wiktor Mazur
2019-12-25 14:14:58 +01:00
parent bef54dee9b
commit 75238241e6
2 changed files with 15 additions and 7 deletions
+10 -2
View File
@@ -30,7 +30,7 @@ impl CombatTime {
#[derive(Debug)]
pub struct Player {
pub id: usize,
id: usize,
damage_dealt: f32,
combat_time: CombatTime,
combat_state: CombatState,
@@ -38,7 +38,7 @@ pub struct Player {
fame: f32,
items: Items,
idle: bool,
pub main: bool
main: bool
}
@@ -60,6 +60,14 @@ impl Player {
pub fn idle(&self) -> bool {
self.idle
}
pub fn id(&self) -> usize {
self.id
}
pub fn main(&self) -> bool {
self.main
}
}
impl DamageDealer for Player {