diff options
Diffstat (limited to 'src/bin/client/games/slots.rs')
| -rw-r--r-- | src/bin/client/games/slots.rs | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/bin/client/games/slots.rs b/src/bin/client/games/slots.rs deleted file mode 100644 index ff55274..0000000 --- a/src/bin/client/games/slots.rs +++ /dev/null | |||
| @@ -1,61 +0,0 @@ | |||
| 1 | use crate::games::traits::{Game, GameState}; | ||
| 2 | |||
| 3 | pub struct SlotsGame; | ||
| 4 | |||
| 5 | impl SlotsGame { | ||
| 6 | pub fn new() -> Self { | ||
| 7 | Self | ||
| 8 | } | ||
| 9 | |||
| 10 | fn render_reels(&self, reels: &str) -> String { | ||
| 11 | if reels.is_empty() { | ||
| 12 | "[ ? ] [ ? ] [ ? ]".to_string() | ||
| 13 | } else { | ||
| 14 | let chars: Vec<char> = reels.chars().collect(); | ||
| 15 | format!( | ||
| 16 | "[ {} ] [ {} ] [ {} ]\r", | ||
| 17 | chars.get(0).unwrap_or(&'?'), | ||
| 18 | chars.get(1).unwrap_or(&'?'), | ||
| 19 | chars.get(2).unwrap_or(&'?') | ||
| 20 | ) | ||
| 21 | } | ||
| 22 | } | ||
| 23 | } | ||
| 24 | |||
| 25 | impl Game for SlotsGame { | ||
| 26 | fn get_name(&self) -> &'static str { | ||
| 27 | "Slots" | ||
| 28 | } | ||
| 29 | |||
| 30 | fn render(&self, state: &GameState) -> String { | ||
| 31 | let reels = state.data.get("reels").cloned().unwrap_or_default(); | ||
| 32 | |||
| 33 | format!( | ||
| 34 | "=== SLOTS ===\r\nBet: {} PLN\r\n{}\r\n\r\nPress [SPACE] to spin!\r\n\r\nControls: [+/-] Adjust Bet [Q] Quit", | ||
| 35 | state.bet_amount, | ||
| 36 | self.render_reels(&reels) | ||
| 37 | ) | ||
| 38 | } | ||
| 39 | |||
| 40 | fn render_lines(&self, _state: &GameState) -> usize { | ||
| 41 | 6 | ||
| 42 | } | ||
| 43 | |||
| 44 | fn get_help(&self) -> String { | ||
| 45 | "SLOTS GAME\n\ | ||
| 46 | =========\n\ | ||
| 47 | Match symbols to win!\n\ | ||
| 48 | \n\ | ||
| 49 | Payouts:\n\ | ||
| 50 | Three of a kind: 2x-28x bet\n\ | ||
| 51 | Two of a kind: 1x-3x bet\n\ | ||
| 52 | \n\ | ||
| 53 | Symbols: C=Cherry, L=Lemon, O=Orange, G=Grapes, D=Diamond, S=Seven\n\ | ||
| 54 | \n\ | ||
| 55 | Controls:\n\ | ||
| 56 | SPACE - Spin the reels\n\ | ||
| 57 | +/- - Adjust bet amount\n\ | ||
| 58 | Q - Exit the game" | ||
| 59 | .to_string() | ||
| 60 | } | ||
| 61 | } | ||
