The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
       generateStars()                                                                    
                                                                                     
       This function returns the star types and relative positions                   
       for a system in an arrayref of four arrayrefs, each corresponding
       to the primary, near-companion stars, far primary, 
       and far near-companion stars. 
                                                                                     
       NOTE: The "primary" is here defined as the star that                           
       the mainworld is orbiting.                                                    
                                                                                     

NAME

Games::Traveller::UwpTools - Tools for Universal World Profile (UWP) manipulation for the Traveller role-playing game.

SYNOPSIS

   This package requires Games::Traveller::UWP.pm.
   
   my $uwp1 = new Games::Traveller::UWP;
   my $uwp2 = new Games::Traveller::UWP;
   
   my $ut   = new Games::Traveller::UwpTools;

   $uwp1->readUwp( 'Foodle   1910 A000000-0 M Ri In     023 Im K7 V' );
   $uwp2->readUwp( 'Blarney  0524 B123456-7             400 Im K7 V' );

   # distance calculations
      
   print $ut->distance( $uwp1, $uwp2 );
   print $ut->galacticDistance( $uwp1, 'spinward marches',
                                $uwp2, 'vland' );

 
   # random UWP
   
   $ut->randomUwp( $uwp );
   
   print $uwp->toString(), "\n";
   
   # revised stellar generation
   
   $ut->generateStars( $uwp );
   
   print $uwp->stars;
   
   # world classification
   
   my @cn = $ut->classifyWorld( $uwp );

   print $uwp->toString(), ' ', $cn[0]->[0], "\n";
                                   
   

DESCRIPTION

The UwpTools package is a utilitu module for UWP manipulation. With it, you can do distance calculation (even across sectors), random UWP generation, Revised Stellar Generation, and World Classification.

OVERVIEW OF CLASS AND METHODS

To create an instance:

   my $ut = new Games::Traveller::UwpTools;

   The utility methods are: 
       $ut->distance( $uwp1, $uwp2 )
       returns the number of parsecs between the two.
       
       $ut->galacticDistance( $uwp1, $sector1, $uwp2, $sector2 )
       returns the number of parsecs between the two.
       At least these sectors are currently supported:
       
          'gvurrdon'        
          'tuglikki'        
          'spinward marches'
          'deneb'           
          'corridor'        
          'vland'           
          'lishun'          
          'antares'         
          'trojan reaches'  
          'reft'            
          'gushemege'       
          'dagudashaag'     
          'core'            
          'riftspan'        
          'verge'           
          'ilelish'         
          'zarushagar'      
          'massilia'        
          'delphi'          
          'reavers deep'    
          'daibei'          
          'diaspora'        
          'old expanses'    
          'dark nebula'     
          'magyar'          
          'solomani rim'    
          'alpha crucis'    
    
       $ut->randomUwp() returns a new, random UWP
    
       $ut->generateStars( $uwp ) uses Malenfant's Revised Stellar 
       Generation System to generate the stars for this system.
       This method is slightly 'enhanced', in that it is (slightly)
       possible to generate more stars than Malenfant's system.
          
       $ut->classifyWorld( $uwp ) attempts to classify the potential
       world types this UWP would fit under.  The method returns
       an array of array references.  Each array reference contains
       the following elements:
       
       [ classification, abbreviation, orbit ]
       
       where
       
       classification is the string classification match,
       abbreviation is the abbreviation for the classification,
       and orbit is the orbit this classification requires.
       

AUTHOR

  Pasuuli Immuguna

COPYRIGHT

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

AVAILABILITY

The latest version of this library is likely to be available from CPAN.