Volity::Game

Volity::Game is a base class for Volity game modules.
Download

Volity::Game Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jason McIntosh
  • Publisher web site:
  • http://volity.org/projects/gamut/

Volity::Game Tags


Volity::Game Description

Volity::Game is a base class for Volity game modules. Volity::Game is a base class for Volity game modules.SYNOPSISSee Volity::Game::TicTacToe and its source code for a simple but full-featured example.This class provides a framework for writing Volity game modules in Perl. A Volity game module will be a subclass of this class.To turn your subclass into an active Volity parlor, you can pass it to the volityd program via its game_class config option (see volityd).USAGETo use this module, subclass it. Create your own Perl package for your game, and have it inherit from Volity::Game. Then define game logic and other behavior primarily by writing callback methods, as described in "CALLBACK METHODS".See Volity::Game::TicTacToe for a simple but complete example of a Volity::Game subclass.Some things to keep in mind while writing your subclass:It's a pseudohashThe object that results from your class will be a Perl pseudohash that makes use of the fields pragma. (See fields.) As the example shows, you should declare the the instance variables you intend to use with a use fields() invocation.Other than that, an instance if your subclass will work just like a hash-based Perl object.Use (but don't abuse) the initialize() methodThe Volity::Game base class constructor calls initialize() as a final step.If you override this method to peform game-specific initialization on your subclass, it must have a return value of $self->SUPER::initialize(@_). Requirements: · Perl


Volity::Game Related Software