WWW::DaysOfWonder::Memoir44::DB::Scenarios - scenarios database


WWW-DaysOfWonder-Memoir44 documentation  | view source Contained in the WWW-DaysOfWonder-Memoir44 distribution.

Index


NAME

Top

WWW::DaysOfWonder::Memoir44::DB::Scenarios - scenarios database

VERSION

Top

version 2.110310

SYNOPSIS

Top

    my $db = WWW::DaysOfWonder::Memoir44::DB::Scenarios->instance;
    $db->read;
    my @top_scenarios = $db->grep( sub { $_->rating == 3 } );
    $db->clear;
    $db->add( @top_scenarios );
    $db->write;

DESCRIPTION

Top

This class implements a singleton holding all the scenarios available. It is the core of the whole distribution.

METHODS

Top

add

    my $db = WWW::DaysOfWonder::Memoir44::DB::Scenarios->instance;
    $db->add( @scenarios );

Store a new scenario in the scenarios database.

clear

    my $db = WWW::DaysOfWonder::Memoir44::DB::Scenarios->instance;
    $db->clear;

Remove all scenarios from the database.

read

    my $db = WWW::DaysOfWonder::Memoir44::DB::Scenarios->read;

Read the whole scenarios database from a file. The file is internal to the distrib, and stored in a private directory.

write

    my $db = WWW::DaysOfWonder::Memoir44::DB::Scenarios->instance;
    $db->write;

Store the whole scenarios database to a file. The file is internal to the distrib, and stored in a private directory.

AUTHOR

Top

  Jerome Quelin

COPYRIGHT AND LICENSE

Top


WWW-DaysOfWonder-Memoir44 documentation  | view source Contained in the WWW-DaysOfWonder-Memoir44 distribution.