From 4cc7844aac9be987288124a3d42960cfe299d285 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Mon, 9 May 2016 13:11:24 -0700 Subject: [PATCH] Cleanup --- lib/Lacuna/DB/Result/Building.pm | 22 ---------------------- lib/Lacuna/DB/Result/Building/Capitol.pm | 16 ---------------- lib/Lacuna/DB/Result/Map/Body/Planet.pm | 11 +---------- 3 files changed, 1 insertion(+), 48 deletions(-) diff --git a/lib/Lacuna/DB/Result/Building.pm b/lib/Lacuna/DB/Result/Building.pm index eaf2df7db..2d83556c0 100755 --- a/lib/Lacuna/DB/Result/Building.pm +++ b/lib/Lacuna/DB/Result/Building.pm @@ -812,28 +812,6 @@ sub is_not_max_level { if ($self->level >= 30) { confess [1009, 'This building is already at its maximum level.']; } -# my $max_level = 15; -# if ($self->body->empire->university_level > 25) { -# $max_level += ($self->body->empire->university_level - 25); -# } -# if ($self->level >= $max_level && -# 'Resources' ~~ [ $self->build_tags] && (!('Storage' ~~ [$self->build_tags]) -# || $self->isa('Lacuna::DB::Result::Building::Waste::Exchanger'))) { -# # resource buildings except storage buildings (treat a Waste Exchanger as if it were not a storage building) -# my $stockpile = $self->body->get_building_of_class('Lacuna::DB::Result::Building::Stockpile'); -# if (defined $stockpile) { -# if ($max_level + $stockpile->extra_resource_levels > $self->level) { -# return 1; -# } -# else { -# confess [1013, -# sprintf("The maximum level of this building is %d with your University level and stockpile.", -# $max_level + $stockpile->extra_resource_levels), -# ]; -# } -# } -# confess [1013, 'Resource buildings cannot upgrade above level '.$max_level.' without a Stockpile.']; -# } return 1; } diff --git a/lib/Lacuna/DB/Result/Building/Capitol.pm b/lib/Lacuna/DB/Result/Building/Capitol.pm index d2a1631d5..aa0c0a7e6 100644 --- a/lib/Lacuna/DB/Result/Building/Capitol.pm +++ b/lib/Lacuna/DB/Result/Building/Capitol.pm @@ -51,22 +51,6 @@ use constant waste_production => 5; use constant happiness_production => 100; -# before 'can_demolish' => sub { -# my $self = shift; -# my $stockpile = $self->body->get_building_of_class('Lacuna::DB::Result::Building::Stockpile'); -# if (defined $stockpile) { -# confess [1013, 'You have to demolish your Stockpile before you can demolish your Capitol.']; -# } -# }; - -# before 'can_downgrade' => sub { -# my $self = shift; -# my $stockpile = $self->body->get_building_of_class('Lacuna::DB::Result::Building::Stockpile'); -# if (defined $stockpile and $self->level < 11) { -# confess [1013, 'You have to demolish your Stockpile before you can downgrade your Capitol lower than level 10.']; -# } -# }; - before can_build => sub { my $self = shift; my @ids = $self->body->empire->planets->get_column('id')->all; diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet.pm b/lib/Lacuna/DB/Result/Map/Body/Planet.pm index d154ba362..a033dd3a1 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Planet.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Planet.pm @@ -685,6 +685,7 @@ foreach my $arg ( ['mining_ministry','Ore::Ministry'], [qw(network19 Network19)], [qw(development Development)], + ['oracle', 'Permanent::OracleOfAnid'], ['refinery', 'Ore::Refinery'], [qw(spaceport SpacePort)], [qw(stockpile Stockpile)], @@ -704,16 +705,6 @@ foreach my $arg ( ); } -has oracle => ( - is => 'rw', - lazy => 1, - default => sub { - my $self = shift; - my $building = $self->get_building_of_class('Lacuna::DB::Result::Building::Permanent::OracleOfAnid'); - return $building; - }, -); - has build_boost => ( is => 'rw', lazy => 1,