Commits

Shlomi Fish committed 6257ab4

Eliminated the new function from CalcMetaScan and extracted the add_chosen
method.

git-svn-id: file:///home/shlomif/Backup/svn-dumps/google-code/svnsync-repos/fc-solve/trunk@684 e7e8a897-7ba4-4ee7-b36f-f4c66519b19a

  • Participants
  • Parent commits b32dbbe

Comments (0)

Files changed (1)

fc-solve/presets/soft-threads/meta-moves/auto-gen/Shlomif/FCS/CalcMetaScan.pm

     return 0;
 }
 
+sub get_chosen_struct
+{
+    my $self = shift;
+    return
+        {
+            'q' => $self->quota(), 
+            'ind' => $self->scan_idx() 
+        };    
+}
+
 package Shlomif::FCS::CalcMetaScan;
 
 use strict;
 
 __PACKAGE__->mk_accessors(@fields);
 
-sub new
-{
-    my $class = shift;
-    my $self = {};
-    bless $self, $class;
-    $self->initialize(@_);
-    return $self;
-}
-
 sub add
 {
     my ($self, $field, $diff) = @_;
         );
 }
 
+sub add_chosen
+{
+    my $self = shift;
+    my $state = shift;
+
+    push @{$self->chosen_scans()}, $state->get_chosen_struct();
+}
+
 sub inspect_quota
 {
     my ($self, $quotas) = @_;
     my $state = $self->get_selected_scan($quotas)
         or return;
 
-    push @{$self->chosen_scans()}, 
-        {
-            'q' => $state->quota(), 
-            'ind' => $state->scan_idx() 
-        };
+    $self->add_chosen($state);
     $self->selected_scans()->[$state->scan_idx()]->{'used'} = 1;
 
     my $total_boards_solved =