From b3b8d8700f59914e8d32079c0f79bbac3120778e Mon Sep 17 00:00:00 2001 From: Daniel Asher Resnick Date: Fri, 5 Jan 2024 01:17:56 -0600 Subject: [PATCH] Remove defunct subregion code --- HexGrid/Region.pm | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/HexGrid/Region.pm b/HexGrid/Region.pm index 1ed8d3a..2d9c2f6 100644 --- a/HexGrid/Region.pm +++ b/HexGrid/Region.pm @@ -12,11 +12,11 @@ use feature "signatures"; no warnings "experimental::signatures"; has tiles => (is => 'rw', default => sub { {} }); -has subregions => (is => 'rw', default => sub { {} }); has name => (is => 'rw', required => 1); has defaults => (is => 'rw', default => sub { {} }); has id_suffix => (is => 'rw', default => '_region'); +# New region with same properties, but doesn't import tiles sub clone($this) { return HexGrid::Region->new @@ -35,13 +35,6 @@ sub make_tile_at($this, $nw, $sw, %tile_settings) $this->add_tile(HexGrid::Tile::at($nw, $sw, %settings)); } -sub add_subregion($this, $region) { $this->{subregions}{$region->{name}} = $region; } -sub make_subregion($this, $name, %defaults) -{ - my $tile_defaults = merge(\%defaults, $this->{defaults}); - $this->add_subregion(HexGrid::Region->new(name => $name, defaults => $tile_defaults)); -} - sub iter_tile($this, $code) { foreach my $nw (keys %{$this->{tiles}}) @@ -71,15 +64,6 @@ sub render($this, $svg, $laters, $grid) $max_y = $y_translate if $y_translate > $max_y; } } - foreach my $region (keys %{$this->{subregions}}) - { - my $m = $this->{subregions}{$region}->render($svg, $laters, $grid); - - $min_x = $m->{min_x} if $m->{min_x} < $min_x; - $min_y = $m->{min_y} if $m->{min_y} < $min_y; - $max_x = $m->{max_x} if $m->{max_x} > $max_x; - $max_y = $m->{max_y} if $m->{max_y} > $max_y; - } return { min_x => $min_x,min_y => $min_y,max_x => $max_x,max_y => $max_y, group => $g }; }