This commit is contained in:
2026-05-15 08:27:55 -07:00
parent 2e1bab8c52
commit a84903af8e
2 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -4,7 +4,7 @@ use crate::Rng;
pub trait Game {
type Instruction;
fn possible_instructions(&self) -> impl Iterator<Item = Self::Instruction> + use<Self>;
fn validate_instruction(&self, instruction: Self::Instruction) -> bool;
fn is_instruction_valid(&self, instruction: Self::Instruction) -> bool;
fn process_instruction(&mut self, instruction: Self::Instruction);
fn is_win(&self) -> bool;
}
@@ -192,8 +192,8 @@ where
fn possible_instructions(&self) -> impl Iterator<Item = Self::Instruction> + use<G> {
self.state.possible_instructions()
}
fn validate_instruction(&self, instruction: Self::Instruction) -> bool {
self.state.validate_instruction(instruction)
fn is_instruction_valid(&self, instruction: Self::Instruction) -> bool {
self.state.is_instruction_valid(instruction)
}
fn process_instruction(&mut self, instruction: Self::Instruction) {
self.history.push(instruction.clone());