Games::3D::Template - describe an object class and it's keys/settings
use Games::3D::Template; use Games::3D::Thingy; Games::3D::Template->from_string($string); Games::3D::Thingy->new( ... ); # check entire object $template->validate($thingy); # check only one key $template->validate_key($thingy,'name');
Exports nothing on default.
This package provides a validation class for "things" in Games::3D. It defines what the valid keys are, and what their data should look like, and also how this data should be transformed into strings and back to internal data (for instance when saving/loading data).
my $template = Games::3D::Template->new();
Creates a new, empty template.
$template->class();
Return the class of objects this template describes. For instance, 'Games::3D::Foo::Bar'.
$template->validate($thingy);
Validate the entire object $thingy, e.g see if it still confirms to the template.
$thingy
Returns undef for ok, otherwise error message.
$template->validate_key($thingy, $key);
Validate the key $key from object $thingy, e.g see if it still confirms to the template.
$key
Return the templates' unique id. They are independant from all other IDs.
my $fresh = $template->create_thing();
Take your own blueprint and create a thing with default values.
$template->as_string();
Return this template as string.
$template->add_key( );
Add an key to the template.
my $keys = $template->keys();
Return the number of keys in this template.
my @objects = $template->from_string( $string );
Create one or more objets from their string form. See also as_string.
$template->init_thing($thing);
Init all fields in a thing from the blueprint.
(c) 2004, 2006 Tels <http://bloodgate.com/>
Games::3D, Games::Irrlicht.
To install Games::3D, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::3D
CPAN shell
perl -MCPAN -e shell install Games::3D
For more information on module installation, please visit the detailed CPAN module installation guide.