Games::Traveller::Animals -- the Traveller Animal Encounter matrix
use Games::Traveller::UWP; use Games::Traveller::Animals; use Games::Traveller::Animals::AnimalEncounter; my $uwp1 = new Games::Traveller::UWP; $uwp1->readUwp( 'Reference 0140 A887887-A B Ri Cp 323 Im K7 V' ); my $at = new Games::Traveller::Animals; # # Given a world's physical data, generate an animal table. # $at->generateAnimalTable( $uwp1->size, $uwp1->atmosphere, $uwp1->hydrosphere ); # # Fetch the list of terrain types. # print $at->terrainTypes, "\n"; # # Dump the encounter tables in ASCII. # print $at->toString(); # # Access the data individually. # my @terrainTypes = $at->terrainTypes; foreach my $terrain (@terrainTypes) { print "$terrain\n"; my @encounterTable = @{$at->terrainTables->{$terrain}}; foreach my $encounter (@encounterTable) { # # $encounter is of type Games::Traveller::Animals::AnimalEncounter, # which has a bunch of convenient accessors in it. # printf ("%2d%2s %-14s %4s %3.3s/%-2.2s %9.9s %3.3s %-7s %s\n", $self->index, $self->attribute || '', $self->category, $self->mass, $self->hits, $self->dead, $self->weapon, $self->damageMod, $self->armor, $self->behaviour); } }
Pasuuli Immuguna
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The latest version of this library is likely to be available from CPAN.
To install Games::Traveller::Animals, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Traveller::Animals
CPAN shell
perl -MCPAN -e shell install Games::Traveller::Animals
For more information on module installation, please visit the detailed CPAN module installation guide.