GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  GAMES::BINGO::COLUMNCOLLECTION (3)

.ds Aq ’

NAME

Games::Bingo::ColumnCollection - a collection class for holding columns

CONTENTS

SYNOPSIS



        my $col = Games::Bingo::ColumnCollection-E<gt>new();

        my $c = Games::Bingo::Column-E<gt>new(0, [1, 2, 3, 4, 5, 6, 7, 8, 9]);

        $col-E<gt>add_column($c1);

        my $d = $col-E<gt>get_column(1);

        my $e = $col-E<gt>get_random_column();



DESCRIPTION

The ColumnCollection is used when building the bingo cards and is a temporary data structure for holding object of the class Column.

The class is an encapsulated array, which is 1 indexed.

METHODS

    new

The constructor blesses and array and returns.

    divide

The divided method has nothing as such to do with the class apart from it is a helper method, which is used to taking a list of numbers (1-90 expected, see Games::Bingo).

It then divided this list into 9 separate arrays of the following constallations:
o 1-9
o 10-19
o 20-29
o 30-39
o 40-49
o 50-59
o 60-69
o 70-79
o 80-90
From these arrays the Columns are built and the column collection is slowly populated, when done the column collection is returned.

    add_column

This is a push like method, is can be used to add an additional to the collection.

    remove_column

The method can remove a column specified by its index, the argument specifies this index.

    get_column

The method returns a column specified by its index, the argument to this method is the index.

The second argument is an indicator of whether the returned collection should be removed from the list, <B>1B> for removed and <B>0B> for not removing, the latter is the default.

    get_random_column

This method returns a random columns, the optional parameter can be used to indicate whether the column should be removed from the list. <B>1B> indicates a removed and nothing (the default) that nothing should be done.

    reset_columns

The method uses the fact that the class contains Columns and a bit of polymorphy, so this method can be used to set the status of all Columns contained in the class. ’ The parameter is the status which you want to set, either <B>1B> or <B>0B>.

    count_columns

Returns the number of columns in G::B::Column object.

SEE ALSO

Games::Bingo
Games::Bingo::Column

TODO

The TODO file contains a complete list for the whole Games::Bingo project.

ACKNOWLEDGEMENTS

My friend Allan helped me out with some of the algoritmic stuff and was in when this class was thought up.

AUTHOR

Jonas B. Nielsen, (jonasbn) - <jonasbn@cpan.org>

COPYRIGHT

Games-Bingo is (C) by Jonas B. Nielsen, (jonasbn) 2003-2015

Games-Bingo is released under the artistic license 2.0

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 GAMES::BINGO::COLUMNCOLLECTION (3) 2016-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.