RCP/Database/Result/Class.pm

filter: Statementstmt 100% 27 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 100% 32 / 32 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« RCP/Database/Result/CharacterMove.pm ↑ Summary RCP/Database/Result/ClassKind.pm »
1 package Games::Framework::RCP::Database::Result::Class;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 our $VERSION = '0.22';
7  
8 3 ▶use base qw/DBIx::Class/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 3 __PACKAGE__->load_components(qw/UTF8Columns Core/);
11 3 __PACKAGE__->table('classes');
12 3 __PACKAGE__->add_columns(
13 id_class => {
14 data_type => 'integer',
15 is_nullable => 0,
16 is_auto_increment => 1,
17 comments => 'ID of the class.',
18 extra => {unsigned => 1},
19 },
20 name => {
21 data_type => 'varchar',
22 size => 32,
23 is_nullable => 0,
24 comments => 'Name of the class.',
25 },
26 description => {
27 data_type => 'varchar',
28 size => 256,
29 is_nullable => 0,
30 comments => 'Description/flavortext of the class.',
31 },
32 fkey_kind => {
33 data_type => 'integer',
34 is_nullable => 0,
35 comments => 'ID of the class kind.',
36 extra => {unsigned => 1},
37 },
38 hp => {
39 data_type => 'numeric',
40 is_nullable => 0,
41 size => [12,4],
42 comments => 'HP, or health.',
43 },
44 mp => {
45 data_type => 'numeric',
46 is_nullable => 0,
47 size => [12,4],
48 comments => 'MP, or magical power',
49 },
50 pp => {
51 data_type => 'numeric',
52 is_nullable => 0,
53 size => [12,4],
54 comments => 'PP, or physical power',
55 },
56 spd => {
57 data_type => 'numeric',
58 is_nullable => 0,
59 size => [12,4],
60 comments => 'Speed',
61 },
62 patk => {
63 data_type => 'numeric',
64 is_nullable => 0,
65 size => [12,4],
66 comments => 'Physical Attack',
67 },
68 matk => {
69 data_type => 'numeric',
70 is_nullable => 0,
71 size => [12,4],
72 comments => 'Magical Attack',
73 },
74 pdef => {
75 data_type => 'numeric',
76 is_nullable => 0,
77 size => [12,4],
78 comments => 'Physical Defense',
79 },
80 mdef => {
81 data_type => 'numeric',
82 is_nullable => 0,
83 size => [12,4],
84 comments => 'Magical Defense',
85 },
86 pacc => {
87 data_type => 'numeric',
88 is_nullable => 0,
89 size => [12,4],
90 comments => 'Physical Accuracy',
91 },
92 macc => {
93 data_type => 'numeric',
94 is_nullable => 0,
95 size => [12,4],
96 comments => 'Magical Accuracy',
97 },
98 pevd => {
99 data_type => 'numeric',
100 is_nullable => 0,
101 size => [12,4],
102 comments => 'Physical Evade',
103 },
104 mevd => {
105 data_type => 'numeric',
106 is_nullable => 0,
107 size => [12,4],
108 comments => 'Magical Evade',
109 },
110 );
111  
112 3 __PACKAGE__->utf8_columns(qw/name description/);
113 3 __PACKAGE__->set_primary_key('id_class');
114 3 __PACKAGE__->add_unique_constraint(['name']);
115  
116 3 __PACKAGE__->has_many(starting_statuses => 'Games::Framework::RCP::Database::Result::StartingStatus', 'fkey_class');
117 3 __PACKAGE__->many_to_many(statuses => 'starting_statuses', 'status_effect');
118  
119 3 __PACKAGE__->belongs_to(kind => 'Games::Framework::RCP::Database::Result::ClassKind', 'fkey_kind');
120  
121 3 __PACKAGE__->has_many(class_moves => 'Games::Framework::RCP::Database::Result::ClassMove', 'fkey_class');
122 3 __PACKAGE__->many_to_many(moves => 'class_moves', 'move');
123  
124 3 __PACKAGE__->has_many(character_moves => 'Games::Framework::RCP::Database::Result::CharacterMove', 'fkey_class');
125  
126 2 ▶sub sqlt_deploy_hook {
Subroutine sqlt_deploy_hook: called CC=1 SCAR=0.0
Pod documented
127 2 my ($self, $sqlt_table) = @_;
128
129 2 $sqlt_table->options({ENGINE => 'InnoDB'});
130 2 $sqlt_table->options({CHARSET => 'UTF8'});
131 2 $sqlt_table->comments('Simple listing of all jobs and their stats.');
132 }
133  
134 3 1;
135  
136 __END__
« RCP/Database/Result/CharacterMove.pm ↑ Summary RCP/Database/Result/ClassKind.pm »