Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Miniscule progress on groupmind

  • Loading branch information...
commit e44922b43940bce645d9ed10b21ef62469fd1aa8 1 parent 85dac76
T. Alexander Popiel authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 groupmind.pl
View
21 groupmind.pl
@@ -96,6 +96,27 @@
emit_json("Current goals", \@current);
+my @tasks;
+for my $goal (@current) {
+}
+
+sub tasks_for_goal {
+ my $goal = shift;
+
+ my @buildings;
+ for my $name (@{$groups{$_->{name}} || [ $_->{name} ]}) {
+ push(@buildings, eval { $client->find_building($body_id, $name) });
+ }
+ $goal->{count} ||= 1;
+ if (@buildings < $goal->{count}) {
+# { task => "build", name
+
+ }
+ @buildings = sort { $b->{level} <=> $a->{level} } @buildings;
+ @buildings = @buildings[0..$_->{count}] if $_->{count} && @buildings > $_->{count};
+
+}
+
sub emit {
my $message = shift;
my $prefix = shift;
Please sign in to comment.
Something went wrong with that request. Please try again.