Expand description
§Game State Management
This module defines a GameState
struct that manages game-related flags
such as life, score, and game status.
It provides methods for initializing and resetting the game state.
§Example
use rsnaker::game_logic::state::{GameState, GameStatus};
let mut state = GameState::new(3); // Initialize game_logic with 3 lives
assert_eq!(state.life, 3);
assert_eq!(state.score, 0);
assert_eq!(state.status, GameStatus::Playing);
state.reset(); // Reset game_logic state
assert_eq!(state.life, 3);
assert_eq!(state.score, 0);
Structs§
- Game
State - Manages the game state, including life count, score, and current status.
Enums§
- Game
Status - Represents the possible states of the game.