GclkCounter - The Heart of GameClock


Chess-GameClock-GameClock documentation  | view source Contained in the Chess-GameClock-GameClock distribution.

Index


NAME

Top

  GclkCounter - The Heart of GameClock

VERSION

Top

Version 1.0

SYNOPSIS

Top

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

Top

&capture &stop $start

FUNCTIONS

Top

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:

* Change the counter states.
* Check times
* Update the time counters
* Update the move counters
* Update the sequence pointers

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

AUTHOR

Top

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

BUGS

Top

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

Top

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

    perldoc GameClock

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/GameClock

* CPAN Ratings

http://cpanratings.perl.org/d/GameClock

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=GameClock

* Search CPAN

http://search.cpan.org/dist/GameClock

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


Chess-GameClock-GameClock documentation  | view source Contained in the Chess-GameClock-GameClock distribution.