| 1 | package Games::EternalLands::MapHelper; | ||
| 2 | |||
| 3 | use 5.008006; | ||
| 4 | use strict; | ||
| 5 | use warnings; | ||
| 6 | use Carp; | ||
| 7 | |||
| 8 | require Exporter; | ||
| 9 | use AutoLoader; | ||
| 10 | |||
| 11 | our @ISA = qw(Exporter); | ||
| 12 | |||
| 13 | # Items to export into callers namespace by default. Note: do not export | ||
| 14 | # names by default without a very good reason. Use EXPORT_OK instead. | ||
| 15 | # Do not simply export all your public functions/methods/constants. | ||
| 16 | |||
| 17 | # This allows declaration use Games::EternalLands::MapHelper ':all'; | ||
| 18 | # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK | ||
| 19 | # will save memory. | ||
| 20 | our %EXPORT_TAGS = ( 'all' => [ qw( | ||
| 21 | getRegion findRegions findPathFromTo getZ | ||
| 22 | ) ] ); | ||
| 23 | |||
| 24 | our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); | ||
| 25 | |||
| 26 | our @EXPORT = qw( | ||
| 27 | |||
| 28 | ); | ||
| 29 | |||
| 30 | our $VERSION = '0.04'; | ||
| 31 | |||
| 32 | sub AUTOLOAD { | ||
| 33 | # This AUTOLOAD is used to 'autoload' constants from the constant() | ||
| 34 | # XS function. | ||
| 35 | |||
| 36 | my $constname; | ||
| 37 | our $AUTOLOAD; | ||
| 38 | ($constname = $AUTOLOAD) =~ s/.*:://; | ||
| 39 | croak "&MapHelper::constant not defined" if $constname eq 'constant'; | ||
| 40 | my ($error, $val) = constant($constname); | ||
| 41 | if ($error) { croak $error; } | ||
| 42 | { | ||
| 43 | no strict 'refs'; | ||
| 44 | # Fixed between 5.005_53 and 5.005_61 | ||
| 45 | #XXX if ($] >= 5.00561) { | ||
| 46 | #XXX *$AUTOLOAD = sub () { $val }; | ||
| 47 | #XXX } | ||
| 48 | #XXX else { | ||
| 49 | *$AUTOLOAD = sub { $val }; | ||
| 50 | #XXX } | ||
| 51 | } | ||
| 52 | goto &$AUTOLOAD; | ||
| 53 | } | ||
| 54 | |||
| 55 | require XSLoader; | ||
| 56 | XSLoader::load('Games::EternalLands::MapHelper', $VERSION); | ||
| 57 | |||
| 58 | # Preloaded methods go here. | ||
| 59 | |||
| 60 | # Autoload methods go after =cut, and are processed by the autosplit program. | ||
| 61 | |||
| 62 | 1; | ||
| 63 | __END__ |