| 1 | package Games::Framework::RCP::Database::Result::StatusEffect; | ||
| 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('status_effects'); | |
| 12 | 3 | __PACKAGE__->add_columns( | |
| 13 | id_status_effect => { | ||
| 14 | data_type => 'integer', | ||
| 15 | is_nullable => 0, | ||
| 16 | is_auto_increment => 1, | ||
| 17 | comments => 'ID of the status effect.', | ||
| 18 | extra => {unsigned => 1}, | ||
| 19 | }, | ||
| 20 | name => { | ||
| 21 | data_type => 'varchar', | ||
| 22 | size => 32, | ||
| 23 | is_nullable => 0, | ||
| 24 | comments => 'Name of the status effect.', | ||
| 25 | }, | ||
| 26 | abbr => { | ||
| 27 | data_type => 'varchar', | ||
| 28 | size => 8, | ||
| 29 | is_nullable => 1, | ||
| 30 | default_value => undef, | ||
| 31 | comments => 'Abbreviation of the status effect.', | ||
| 32 | }, | ||
| 33 | description => { | ||
| 34 | data_type => 'varchar', | ||
| 35 | size => 100, | ||
| 36 | is_nullable => 0, | ||
| 37 | comments => 'Description/flavortext of the status effect.', | ||
| 38 | }, | ||
| 39 | fkey_color => { | ||
| 40 | data_type => 'integer', | ||
| 41 | is_nullable => 1, | ||
| 42 | default_value => undef, | ||
| 43 | comments => 'Color of the status effect.', | ||
| 44 | }, | ||
| 45 | is_good => { | ||
| 46 | data_type => 'boolean', | ||
| 47 | is_nullable => 1, | ||
| 48 | default_value => 'true', | ||
| 49 | comments => 'Is the status effect generally helpful? NULL = Neutral.', | ||
| 50 | }, | ||
| 51 | is_secret => { | ||
| 52 | data_type => 'boolean', | ||
| 53 | is_nullable => 0, | ||
| 54 | default_value => 'false', | ||
| 55 | comments => 'Is the status effect generally hidden from the public?', | ||
| 56 | }, | ||
| 57 | default_length => { | ||
| 58 | data_type => 'numeric', | ||
| 59 | size => [12,4], | ||
| 60 | is_nullable => 0, | ||
| 61 | default_value => 31, | ||
| 62 | comments => 'The default length of the status effect. 10K and over: permament. -10K and below: indefinite.', | ||
| 63 | }, | ||
| 64 | |||
| 65 | ); | ||
| 66 | |||
| 67 | 3 | __PACKAGE__->utf8_columns(qw/name description/); | |
| 68 | 3 | __PACKAGE__->set_primary_key('id_status_effect'); | |
| 69 | 3 | __PACKAGE__->add_unique_constraint( [qw(name)] ); | |
| 70 | |||
| 71 | 3 | __PACKAGE__->has_many(starting_statuses => 'Games::Framework::RCP::Database::Result::StartingStatus', 'fkey_status_effect'); | |
| 72 | 3 | __PACKAGE__->many_to_many(statuses => 'starting_statuses', 'class'); | |
| 73 | |||
| 74 | 3 | __PACKAGE__->has_many(items_with_statuses => 'Games::Framework::RCP::Database::Result::ItemWithStatus', 'fkey_status_effect'); | |
| 75 | 3 | __PACKAGE__->many_to_many(items => 'items_with_statuses', 'status_effects'); | |
| 76 | |||
| 77 | 3 | __PACKAGE__->belongs_to(color => 'Games::Framework::RCP::Database::Result::Color', 'fkey_color'); | |
| 78 | |||
| 79 | 2 | ▶ | sub sqlt_deploy_hook { |
|
Subroutine
sqlt_deploy_hook: called CC=1 SCAR=0.0
Pod
documented
| |||
| 80 | 2 | my ($self, $sqlt_table) = @_; | |
| 81 | |||
| 82 | 2 | $sqlt_table->options({ENGINE => 'InnoDB'}); | |
| 83 | 2 | $sqlt_table->options({CHARSET => 'UTF8'}); | |
| 84 | 2 | $sqlt_table->comments('The big list of status effects.'); | |
| 85 | } | ||
| 86 | |||
| 87 | 3 | 1; | |
| 88 | |||
| 89 | __END__ | ||