Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ally move filter #100

Merged
merged 3 commits into from
Oct 21, 2022
Merged

Ally move filter #100

merged 3 commits into from
Oct 21, 2022

Conversation

wwongkamjan
Copy link
Contributor

related to #92 but still have to add enemy move filter. I want to pull the ally move filter first

@vercel
Copy link

vercel bot commented Oct 21, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
baseline-bots ✅ Ready (Inspect) Visit Preview Oct 21, 2022 at 5:44PM (UTC)

@@ -287,6 +290,102 @@ def generate_support_proposals(self, comms_obj: MessagesData) -> Dict[str, str]:
final_messages[recipient] = str(suggested_proposals)
comms_obj.add_message(recipient, str(suggested_proposals))
return final_messages

def is_order_aggressive_to_powers(self, order: str, powers: List[str]):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to see a test for this function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a test for the whole process. Will later add the test case!

return False

@gen.coroutine
def get_non_aggressive_order(self, order: str, powers: List[str]):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would also like to see a test for this function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that can be added too.

if not len(ally):
return
final_orders = []
for order in self.orders.get_list_of_orders():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments needed

self.orders = orders_data

# filter out aggressive orders to allies
yield self.replace_aggressive_order_to_allies()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would highly prefer a pattern in which orders are passed into and out of this function, e.g.

orders = yield self.replace_aggressive_order_to_allies(best_orders)

@kartik2112
Copy link
Contributor

Resolves #91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants