| 1 | use strict; | ||
| 2 | use warnings; | ||
| 3 | #use feature qw( say ); | ||
| 4 | |||
| 5 | # Class for pause-related values | ||
| 6 | # A class without instances | ||
| 7 | # This class has been introduced to reduce the number of global variables | ||
| 8 | |||
| 9 | package | ||
| 10 | Games::Sudoku::Trainer::Pause; | ||
| 11 | |||
| 12 | use version; our $VERSION = qv('0.01'); # PBP | ||
| 13 | |||
| 14 | my $Mode = ''; # current pause mode | ||
| 15 | my $Mode_restriction = ''; # restriction of current pause mode | ||
| 16 | my $Strat = ''; # strategy that caused this pause | ||
| 17 | my $Info_ref; # ref to the info structure | ||
| 18 | # of the strat that caused this pause | ||
| 19 | # for details see doku of array @found | ||
| 20 | # at the top of file Strategies.pm | ||
| 21 | |||
| 22 | sub Mode { return $Mode } # getter for Mode | ||
| 23 | sub setMode { $Mode = $_[1]; return } # setter for Mode | ||
| 24 | sub Mode_restriction { return $Mode_restriction } # getter for Mode_restriction | ||
| 25 | |||
| 26 | # setter for Mode_restriction | ||
| 27 | sub setMode_restriction { | ||
| 28 | $Mode_restriction = $_[1]; | ||
| 29 | return; | ||
| 30 | } | ||
| 31 | |||
| 32 | sub Strat { return $Strat } # getter for Strat | ||
| 33 | sub setStrat { $Strat = $_[1]; return } # setter for Strat | ||
| 34 | sub Info_ref { return $Info_ref } # getter for Info_ref | ||
| 35 | sub setInfo_ref { $Info_ref = $_[1]; return } # setter for Info_ref | ||
| 36 | |||
| 37 | 1; |