File Coverage

blib/lib/Poker/Robot/Chair.pm
Criterion Covered Total %
statement 3 10 30.0
branch n/a
condition n/a
subroutine 1 2 50.0
pod 0 1 0.0
total 4 13 30.7


line stmt bran cond sub pod time code
1             package Poker::Robot::Chair;
2 1     1   3 use Moo;
  1         1  
  1         4  
3              
4             =encoding utf8
5              
6             =head1 NAME
7              
8             Poker::Robot::Chair - Simple class to represent a poker chair. Used internally by Poker::Robot
9              
10             =head1 VERSION
11              
12             Version 0.01
13              
14             =cut
15              
16             our $VERSION = '0.01';
17              
18             has 'table_id' => (
19             is => 'rw',
20             );
21              
22             has 'login_id' => (
23             is => 'rw',
24             );
25              
26             has 'user_id' => (
27             is => 'rw',
28             );
29              
30             has 'chips' => (
31             is => 'rw',
32             );
33              
34             has 'chair' => (
35             is => 'rw',
36             );
37              
38             has 'valid_act' => (
39             is => 'rw',
40             isa => sub { die "Not an array_ref!" unless ref( $_[0] ) eq 'ARRAY' },
41             );
42              
43             has 'cards' => (
44             is => 'rw',
45             isa => sub { die "Not an array_ref!" unless ref( $_[0] ) eq 'ARRAY' },
46             default => sub { [] },
47             );
48              
49             has 'posted' => (
50             is => 'rw',
51             default => sub { return 0 },
52             );
53              
54             has 'auto_muck' => (
55             is => 'rw',
56             default => sub { return 1 },
57             );
58              
59             has 'payout' => (
60             is => 'rw',
61             clearer => 1,
62             );
63              
64             has 'index' => ( is => 'rw', );
65              
66             has 'hi_hand' => (
67             is => 'rw',
68             isa => sub { die "Not a hash.\n" unless ref( $_[0] ) eq 'HASH' },
69             clearer => 1,
70             );
71              
72             has 'low_hand' => (
73             is => 'rw',
74             isa => sub { die "Not a hash.\n" unless ref( $_[0] ) eq 'HASH' },
75             clearer => 1,
76             );
77              
78             has 'is_in_hand' => (
79             is => 'rw',
80             default => sub { return 0; },
81             );
82              
83             has 'in_pot' => (
84             is => 'rw',
85             default => sub { return 0; },
86             );
87              
88             has 'in_pot_this_round' => (
89             is => 'rw',
90             default => sub { return 0; },
91             );
92              
93             sub reset {
94 0     0 0   my $self = shift;
95 0           $self->is_in_hand(0);
96 0           $self->in_pot(0);
97 0           $self->in_pot_this_round(0);
98 0           $self->clear_low_hand;
99 0           $self->clear_hi_hand;
100 0           $self->clear_payout;
101             }
102              
103             =head1 AUTHOR
104              
105             Nathaniel Graham, C
106              
107             =head1 BUGS
108              
109             Please report any bugs or feature requests directly to C
110              
111             =head1 LICENSE AND COPYRIGHT
112              
113             Copyright 2016 Nathaniel Graham.
114              
115             This program is free software; you can redistribute it and/or modify it
116             under the terms of the MIT license.
117              
118             =cut
119              
120             1;