# # $Id: CardUndo.pm,v 4.7 2002/07/21 06:49:52 kono Exp $ # package CardPlay::CardUndo; use strict; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK ); require Exporter; require AutoLoader; @ISA = qw(Exporter AutoLoader); @EXPORT = qw( ); $VERSION = "0.2"; use Tk; use Carp; # class method sub new { my ($types) = shift; my $self; %{$self} = @_; bless $self; } # instance method sub print { my ($self) = @_; my ($card); print STDERR "card ",$self->{'-mode'},":"; if ( defined ($card = $self->{'-card'})) { print STDERR $card->{'-suit'}, $card->{'-number'},"\n"; } } sub undo { my ($self) = @_; if ($self->{'-mode'} eq 'open') { $self->{'-card'}->hide(); } else { $self->{'-card'}->open(); } } sub redo { my ($self) = @_; if ($self->{'-mode'} eq 'open') { $self->{'-card'}->open(); } else { $self->{'-card'}->hide(); } } 1; # end