From 4aeef4ca4f6587e551e5f096bdc6f7a5d1d03c73 Mon Sep 17 00:00:00 2001 From: Darin McBride Date: Tue, 21 Jul 2015 21:55:11 -0600 Subject: [PATCH] Provide image as part of ships. --- lib/Lacuna/DB/Result/Ships.pm | 7 +++++++ lib/Lacuna/RPC/Building/Shipyard.pm | 1 + 2 files changed, 8 insertions(+) diff --git a/lib/Lacuna/DB/Result/Ships.pm b/lib/Lacuna/DB/Result/Ships.pm index c0980b46..19d59282 100644 --- a/lib/Lacuna/DB/Result/Ships.pm +++ b/lib/Lacuna/DB/Result/Ships.pm @@ -282,6 +282,12 @@ sub type_human { return $type; } +# allow each ship to change the image as we go. +sub image { + my $self = shift; + $self->type; +} + sub date_started_formatted { my $self = shift; return format_date($self->date_started); @@ -299,6 +305,7 @@ sub get_status { name => $self->name, type_human => $self->type_formatted, type => $self->type, + image => $self->image, task => $self->task, speed => $self->speed, fleet_speed => $self->fleet_speed, diff --git a/lib/Lacuna/RPC/Building/Shipyard.pm b/lib/Lacuna/RPC/Building/Shipyard.pm index 4b308b17..5632ad07 100644 --- a/lib/Lacuna/RPC/Building/Shipyard.pm +++ b/lib/Lacuna/RPC/Building/Shipyard.pm @@ -351,6 +351,7 @@ sub get_buildable { can => ($can) ? 1 : 0, reason => $reason, type_human => $ship->type_formatted, + image => $ship->image, }; } my $docks = 0; -- 2.51.2