NAME
WWW::DaysOfWonder::Memoir44::DB::Scenarios - scenarios database
VERSION
version 3.000
SYNOPSIS
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
This class implements a singleton holding all the scenarios available. It is the core of the whole distribution.
METHODS
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
Jerome Quelin
COPYRIGHT AND LICENSE
This software is copyright (c) 2009 by Jerome Quelin.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.