| 1 | # | ||||||||||
| 2 | # This file is part of WWW-DaysOfWonder-Memoir44 | ||||||||||
| 3 | # | ||||||||||
| 4 | # This software is copyright (c) 2009 by Jerome Quelin. | ||||||||||
| 5 | # | ||||||||||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||||||||||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||||||||||
| 8 | # | ||||||||||
| 9 | 5 | ▶ | use 5.010; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 5 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | package WWW::DaysOfWonder::Memoir44::Types; | ||||||||||
| 14 | # ABSTRACT: various types used in the distribution | ||||||||||
| 15 | 5 | $WWW::DaysOfWonder::Memoir44::Types::VERSION = '3.000'; | |||||||||
| 16 | 5 | ▶ | use Moose::Util::TypeConstraints; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | 5 | enum Board => [ qw{ beach country winter desert } ]; | |||||||||
| 19 | 5 | enum Format => [ qw{ standard brkthru overlord } ]; | |||||||||
| 20 | 5 | enum Source => [ qw{ game approved classified public } ]; | |||||||||
| 21 | |||||||||||
| 22 | subtype 'Int_0_3', | ||||||||||
| 23 | as 'Int', | ||||||||||
| 24 | 0 | ▶ | where { $_>=0 && $_<=3 }, | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||
| 25 | 0 | ▶ | message { "Integer should be between 0 and 3\n" }; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 26 | |||||||||||
| 27 | coerce 'Int_0_3', | ||||||||||
| 28 | from 'Int', | ||||||||||
| 29 | 0 | ▶ | via { 0+$_ }; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 30 | |||||||||||
| 31 | 5 | 1; | |||||||||
| 32 | |||||||||||
| 33 | __END__ | ||||||||||