diff --git a/src/types/game_high_score.rs b/src/types/game_high_score.rs index 2d59ae8c..f713b18e 100644 --- a/src/types/game_high_score.rs +++ b/src/types/game_high_score.rs @@ -17,3 +17,24 @@ pub struct GameHighScore { /// Score. pub score: u32, } + +impl GameHighScore { + pub fn new(position: u32, user: User, score: u32) -> Self { + Self { position, user, score } + } + + pub fn position(mut self, val: u32) -> Self { + self.position = val; + self + } + + pub fn user(mut self, val: User) -> Self { + self.user = val; + self + } + + pub fn score(mut self, val: u32) -> Self { + self.score = val; + self + } +}