package Colloseum;
use strict;
use warnings;
use Class::DBI::mysql;

sub testColloseum {
  return "Colloseum is loaded";
}

my $DB_USER = 'eholder';
my $DB_PASS = 'eholder_pa55';
my $DB_DATA = 'eholder_db';
my $dsn     = "DBI:mysql:database=$DB_DATA";

# Define the database connection
use base 'Class::DBI::mysql';
__PACKAGE__->set_db('Main', $dsn, $DB_USER, $DB_PASS);
__PACKAGE__->autoupdate(1);

package Biography;
use base 'Colloseum';
__PACKAGE__->set_up_table('Biography');
#__PACKAGE__->columns(All => qw/name /);
#__PACKAGE__->has_a(combatant => 'Combatant');
1;

package Stats;
use base 'Colloseum';
__PACKAGE__->set_up_table('Stats');
#__PACKAGE__->has_a(combatant => 'Combatant');
1;

package Combat_Stats;
use base 'Colloseum';
__PACKAGE__->set_up_table('Combat_Stats');
#__PACKAGE__->has_a(combatant => 'Combatant');
1;

package Combat_Records;
use base 'Colloseum';
__PACKAGE__->set_up_table('Combat_Records');
#__PACKAGE__->has_a(combatant => 'Combatant');
1;

package Appearance;
use base 'Colloseum';
__PACKAGE__->set_up_table('Appearance');
__PACKAGE__->has_a(hair => 'Hair_Color');
__PACKAGE__->has_a(eyes => 'Eye_Color');
__PACKAGE__->has_a(skin => 'Skin_Tone');
__PACKAGE__->has_a(gender => 'Gender');
#__PACKAGE__->has_a(combatant => 'Combatant');
1;

package Hair_Color;
use base 'Colloseum';
__PACKAGE__->set_up_table('Hair_Color');
__PACKAGE__->has_many(appearances => 'Appearance');
1;

package Eye_Color;
use base 'Colloseum';
__PACKAGE__->set_up_table('Eye_Color');
__PACKAGE__->has_many(appearances => 'Appearance');
1;

package Skin_Tone;
use base 'Colloseum';
__PACKAGE__->set_up_table('Skin_Tone');
__PACKAGE__->has_many(appearances => 'Appearance');
1;

package Gender;
use base 'Colloseum';
__PACKAGE__->set_up_table('Gender');
__PACKAGE__->has_many(appearances => 'Appearance');
1;

package Combatant;
use base 'Colloseum';
__PACKAGE__->set_up_table('Combatant');
__PACKAGE__->has_a(bio => 'Biography');
__PACKAGE__->has_a(stats => 'Stats');
__PACKAGE__->has_a(combatstats => 'Combat_Stats');
__PACKAGE__->has_a(record => 'Combat_Records');
__PACKAGE__->has_a(appearance => 'Appearance');
1;

package Colloseum;
# All perl packages must return true.
1;

