Add setters to GameHighScore
@@ -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
+ }
+}
