Charles MINC > Chess-GameClock-GameClock-1.0 > GclkCounter

Download:
Chess-GameClock-GameClock-1.0.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.0   Source  

NAME ^

  GclkCounter - The Heart of GameClock

VERSION ^

Version 1.0

SYNOPSIS ^

This module does everythings at counter level. It makes counters,inits them, update them, captures events, start , halt , eventually print the internal datas

    use GclkCounter;

    $whites=GclkCounter->new ;
    $whites->init($arg,$color) ;
    $whites-> cntupdate{$timestamp);
    $whites->print ;
#  the functions hereafter are only used  inside callbacks
    &start($whites,$blacks,$mainwindow,$white_move_button,$black_move_button)= ;
    &stop($halt_button,$whites,$blacks) ;
    &capture($mouse_event,$whites,$blacks ) ;

EXPORT ^

&capture &stop $start

FUNCTIONS ^

new ;

Create object GclkCounter

init

  Get the parameters from GameClock directly or via Gamesettings
  and adapts the datas for the counters

cntupdate

When an event more precisely a mouse button is released the state of the counter changes. This determines the following actions:

capture

When a mouse event occurs the first time after enabling the start mode, it determines the mouse button for each player, knowing that the Blacks must push the button at first. It set the newsate of each counter accorging to the mouse button pressed, and after that, it gets a timestamp for calling the methode cntupdate.

start

Initialization of the program to begin the counting mode.

stop

This routines halt counters , necessary if one player receive a phone call in a friendly situation ;=) or in some case, when people need that an arbiter comes.

print

Could help for people that wants add new cadences.

AUTHOR ^

Charles Minc, <charles.minc@wanadoo.fr>

BUGS ^

Please report any bugs or feature requests to bug-gclkcounter at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=GameClock. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc GameClock

You can also look for information at:

ACKNOWLEDGEMENTS ^

COPYRIGHT & LICENSE ^

Copyright 2006 Charles Minc, all rights reserved.

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

syntax highlighting: