| 1 | package Game::Terminal::Kit::History; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use 5.014; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 4 | ▶ | use Carp (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 4 | ▶ | use Object::Proto::Sugar -types; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 4 | ▶ | use State::Store 0.02; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use Game::Terminal::Kit::Save; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | 4 | our $VERSION = '0.06'; | |||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | has [qw/save load/] => ( | ||||||||||||||||||||||||||||||||||||||||||
| 15 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||
| 16 | isa => CodeRef | ||||||||||||||||||||||||||||||||||||||||||
| 17 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | has limit => ( | ||||||||||||||||||||||||||||||||||||||||||
| 20 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||
| 21 | isa => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 22 | default => 200 | ||||||||||||||||||||||||||||||||||||||||||
| 23 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | has store => ( | ||||||||||||||||||||||||||||||||||||||||||
| 26 | is => 'rw' | ||||||||||||||||||||||||||||||||||||||||||
| 27 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | has begun => ( | ||||||||||||||||||||||||||||||||||||||||||
| 30 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||
| 31 | isa => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 32 | default => 0 | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | has resumed => ( | ||||||||||||||||||||||||||||||||||||||||||
| 36 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||
| 37 | isa => Bool, | ||||||||||||||||||||||||||||||||||||||||||
| 38 | default => 0 | ||||||||||||||||||||||||||||||||||||||||||
| 39 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | has [qw/name version file/] => ( | ||||||||||||||||||||||||||||||||||||||||||
| 42 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||
| 43 | isa => Str | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | has settings => ( | ||||||||||||||||||||||||||||||||||||||||||
| 47 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||
| 48 | isa => HashRef | ||||||||||||||||||||||||||||||||||||||||||
| 49 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | 50 | ▶ | sub BUILD { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BUILD: called CC=5 SCAR=16.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 52 | 50 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 53 | 50 | ▶ | Carp::croak('Game::Terminal::Kit::History: save and load are both needed') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$self->save and $self->load
MC/DC50%1/2
$self->save and $self->load
$self->save
$self->load
Truth table66%2/3
A and B
A= $self->saveB= $self->load
| |||||||||||||||||||||||||||||||||||||||||||
| 54 | unless $self->save && $self->load; | ||||||||||||||||||||||||||||||||||||||||||
| 55 | 49 | ▶ | $self->store(State::Store->new(undef, history => $self->limit > 0 ? $self->limit : undef)) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 56 | unless $self->store; | ||||||||||||||||||||||||||||||||||||||||||
| 57 | 49 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||
| 60 | 480 | ▶ | sub _snapshot { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_snapshot: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||||
| 61 | 480 | my ($self, $game) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 62 | 480 | my $text = $self->save->($game); | |||||||||||||||||||||||||||||||||||||||||
| 63 | 480 | ▶ | Carp::croak('Game::Terminal::Kit::History: save gave ' . (defined $text ? 'a reference' : 'nothing') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition80%4/5
not defined $text or ref $text
ref $game || 'a game'
MC/DC100%2/2
not defined $text or ref $text
not defined $text
ref $text
MC/DC0%0/1
ref $game || 'a game'
ref $game
Truth table100%3/3
not(A) or B
A= not defined $textB= ref $text
Truth table50%1/2
A
A= ref $game
| |||||||||||||||||||||||||||||||||||||||||||
| 64 | . ' for ' . (ref $game || 'a game') . ', where a string is needed') | ||||||||||||||||||||||||||||||||||||||||||
| 65 | if !defined $text || ref $text; | ||||||||||||||||||||||||||||||||||||||||||
| 66 | 478 | return $text; | |||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||
| 69 | 61 | ▶ | sub start { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
start: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 70 | 61 | my ($self, $game) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 71 | 61 | my $text = $self->_snapshot($game); | |||||||||||||||||||||||||||||||||||||||||
| 72 | 60 | ▶ | return $self if $self->resumed && $text eq $self->store->current; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->resumed and $text eq $self->store->current
MC/DC100%2/2
$self->resumed and $text eq $self->store->current
$self->resumed
$text eq $self->store->current
Truth table100%3/3
A and B
A= $self->resumedB= $text eq $self->store->current
| |||||||||||||||||||||||||||||||||||||||||||
| 73 | 54 | $self->resumed(0); | |||||||||||||||||||||||||||||||||||||||||
| 74 | 54 | $self->store->set($text); | |||||||||||||||||||||||||||||||||||||||||
| 75 | 54 | $self->store->clear_history; | |||||||||||||||||||||||||||||||||||||||||
| 76 | 54 | $self->begun(0); | |||||||||||||||||||||||||||||||||||||||||
| 77 | 54 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||
| 80 | 419 | ▶ | sub record { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
record: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 81 | 419 | my ($self, $game) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 82 | 419 | my $text = $self->_snapshot($game); | |||||||||||||||||||||||||||||||||||||||||
| 83 | 418 | ▶ | $self->resumed(0) if $text ne $self->store->current; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 84 | 418 | $self->store->set($text); | |||||||||||||||||||||||||||||||||||||||||
| 85 | 418 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||
| 88 | 108 | ▶ | sub turn { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
turn: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 89 | 108 | my ($self, $game) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 90 | 108 | ▶ | return $self->record($game) if $self->begun; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 91 | 19 | $self->start($game); | |||||||||||||||||||||||||||||||||||||||||
| 92 | 19 | $self->begun(1); | |||||||||||||||||||||||||||||||||||||||||
| 93 | 19 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||
| 96 | 9 | ▶ | sub text { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
text: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 97 | 9 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 98 | 9 | return $self->store->current; | |||||||||||||||||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||
| 101 | 46 | ▶ | sub undo { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
undo: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 102 | 46 | my ($self, $steps) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 103 | 46 | ▶ | return undef unless $self->store->undo(defined $steps ? $steps : 1); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 104 | 41 | $self->resumed(0); | |||||||||||||||||||||||||||||||||||||||||
| 105 | 41 | return $self->_rebuild; | |||||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | 23 | ▶ | sub redo { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
redo: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 109 | 23 | my ($self, $steps) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 110 | 23 | ▶ | return undef unless $self->store->redo(defined $steps ? $steps : 1); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 111 | 19 | $self->resumed(0); | |||||||||||||||||||||||||||||||||||||||||
| 112 | 19 | return $self->_rebuild; | |||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | 60 | ▶ | sub _rebuild { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_rebuild: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 116 | 60 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 117 | 60 | my $game = $self->load->($self->store->current); | |||||||||||||||||||||||||||||||||||||||||
| 118 | 60 | ▶ | Carp::croak('Game::Terminal::Kit::History: load gave nothing back for a saved game') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 119 | unless defined $game; | ||||||||||||||||||||||||||||||||||||||||||
| 120 | 59 | return $game; | |||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||
| 123 | 7 | ▶ | sub steps { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
steps: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 124 | 7 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 125 | 7 | my $store = $self->store; | |||||||||||||||||||||||||||||||||||||||||
| 126 | 7 | ▶ | return $store->undo_count + 1 + $store->redo_count unless wantarray; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 127 | 5 | return ($store->past, $store->current, $store->future); | |||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||
| 130 | 6 | ▶ | sub at { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
at: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 131 | 6 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 132 | 6 | return $self->store->undo_count; | |||||||||||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||
| 135 | 19 | ▶ | sub saved { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
saved: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 136 | 19 | my ($self, @with) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 137 | 19 | ▶ | $self->record(shift @with) if @with % 2; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 138 | 19 | my %with = @with; | |||||||||||||||||||||||||||||||||||||||||
| 139 | 19 | my $store = $self->store; | |||||||||||||||||||||||||||||||||||||||||
| 140 | return Game::Terminal::Kit::Save->new( | ||||||||||||||||||||||||||||||||||||||||||
| 141 | 57 | ▶ | (map { defined $self->$_ ? ($_ => $self->$_) : () } qw/name version file/), | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 142 | 19 | ▶ | settings => { %{ $self->settings || {} } }, | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->settings || {}
MC/DC100%1/1
$self->settings || {}
$self->settings
Truth table100%2/2
A
A= $self->settings
| |||||||||||||||||||||||||||||||||||||||||||
| 143 | limit => $self->limit, | ||||||||||||||||||||||||||||||||||||||||||
| 144 | past => [ $store->past ], | ||||||||||||||||||||||||||||||||||||||||||
| 145 | current => $store->current, | ||||||||||||||||||||||||||||||||||||||||||
| 146 | future => [ $store->future ], | ||||||||||||||||||||||||||||||||||||||||||
| 147 | %with, | ||||||||||||||||||||||||||||||||||||||||||
| 148 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||
| 151 | 16 | ▶ | sub resume { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
resume: called CC=11 SCAR=24.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 152 | 16 | my ($self, $save) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 153 | Carp::croak('Game::Terminal::Kit::History: resume needs a Game::Terminal::Kit::Save') | ||||||||||||||||||||||||||||||||||||||||||
| 154 | 16 | ▶ | unless ref $save && eval { $save->isa('Game::Terminal::Kit::Save') }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
ref $save and eval {
do {
$save->isa("Game::Terminal::Kit::Save")
}
}
MC/DC50%1/2
ref $save and eval {
do {
$save->isa("Game::Terminal::Kit::Save")
}
}
ref $save
eval {
do {
$save->isa("Game::Terminal::Kit::Save")
}
}
Truth table66%2/3
A and B
A= ref $saveB= eval {
do {
$save->isa("Game::Terminal::Kit::Save")
}
}
| |||||||||||||||||||||||||||||||||||||||||||
| 155 | 15 | ▶ | Carp::croak('Game::Terminal::Kit::History: this is a history of ' . $self->name | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $self->name and $self->name ne $save->name
MC/DC100%2/2
defined $self->name and $self->name ne $save->name
defined $self->name
$self->name ne $save->name
Truth table100%3/3
A and B
A= defined $self->nameB= $self->name ne $save->name
| |||||||||||||||||||||||||||||||||||||||||||
| 156 | . ', and that is a save of ' . $save->name) | ||||||||||||||||||||||||||||||||||||||||||
| 157 | if defined $self->name && $self->name ne $save->name; | ||||||||||||||||||||||||||||||||||||||||||
| 158 | 14 | ▶ | my $limit = defined $save->limit ? $save->limit : $self->limit; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 159 | 14 | ▶ | my $store = State::Store->new($save->current, | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 160 | past => $save->past, future => $save->future, | ||||||||||||||||||||||||||||||||||||||||||
| 161 | history => $limit > 0 ? $limit : undef); | ||||||||||||||||||||||||||||||||||||||||||
| 162 | 14 | my $game = $self->load->($store->current); | |||||||||||||||||||||||||||||||||||||||||
| 163 | 14 | ▶ | Carp::croak('Game::Terminal::Kit::History: load gave nothing back for the saved game') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 164 | unless defined $game; | ||||||||||||||||||||||||||||||||||||||||||
| 165 | 13 | $self->store($store); | |||||||||||||||||||||||||||||||||||||||||
| 166 | 13 | $self->limit($limit); | |||||||||||||||||||||||||||||||||||||||||
| 167 | 13 | ▶ | $self->name($save->name) unless defined $self->name; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 168 | 13 | ▶ | $self->file($save->file) if defined $save->file; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 169 | 13 | ▶ | $self->settings({ %{ $save->settings } }) unless $self->settings; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 170 | 13 | $self->begun(1); | |||||||||||||||||||||||||||||||||||||||||
| 171 | 13 | $self->resumed(1); | |||||||||||||||||||||||||||||||||||||||||
| 172 | 13 | return $game; | |||||||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||
| 175 | 6 | ▶ | sub can_undo { return $_[0]->store->can_undo ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
can_undo: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||
| 177 | 6 | ▶ | sub can_redo { return $_[0]->store->can_redo ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
can_redo: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||
| 179 | 26 | ▶ | sub undo_count { return $_[0]->store->undo_count } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
undo_count: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||
| 181 | 12 | ▶ | sub redo_count { return $_[0]->store->redo_count } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
redo_count: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||
| 183 | 2 | ▶ | sub clear { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
clear: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 184 | 2 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 185 | 2 | $self->store->clear_history; | |||||||||||||||||||||||||||||||||||||||||
| 186 | 2 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||
| 189 | 1 | ▶ | sub game_keys { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
game_keys: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 190 | 1 | return { u => 'undo', r => 'redo' }; | |||||||||||||||||||||||||||||||||||||||||
| 191 | } | ||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||
| 193 | 5 | ▶ | sub legend { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
legend: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 194 | 5 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 195 | 5 | ▶ | return join ', ', ($self->can_undo ? 'u undo' : ()), ($self->can_redo ? 'r redo' : ()); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||
| 198 | 4 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||
| 200 | __END__ | ||||||||||||||||||||||||||||||||||||||||||