mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
Add setters to GameHighScore
This commit is contained in:
parent
83631cc351
commit
b0c78e8125
1 changed files with 21 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue