Add setters to GameHighScore

This commit is contained in:
Temirkhan Myrzamadi 2020-07-27 17:31:23 +06:00
parent 83631cc351
commit b0c78e8125

View file

@ -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
}
}