The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Games::Sudoku::Component::Controller::History

SYNOPSIS

  use Games::Sudoku::Component::Controller::History;
  my $history = Games::Sudoku::Component::Controller::History->new;

  my $item = Games::Sudoku::Component::Table::Item->new(
    row => 1,
    col => 2,
    allowed => [1,3],
  );

  $history->push($item);

  my $item2 = $history->pop;

DESCRIPTION

This module provides a history stack for Games::Sudoku::Component::Controller.

METHODS

new

Creates an object.

push (object)

Stores an object (supposedly of Games::Sudoku::Component::Table::Item) in the stack.

pop

Retrieves an object (supposedly of Games::Sudoku::Component::Table::Item) from the stack.

latest (integer)

Returns an array of the number of objects stored in the stack.

count

Returns how many items are stored in the stack.

clear

Clears the stack.

SEE ALSO

Games::Sudoku::Component,
Games::Sudoku::Component::Controller,
Games::Sudoku::Component::Table

AUTHOR

Kenichi Ishigaki, <ishigaki@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2006 by Kenichi Ishigaki

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.