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

feat: refactor Hive class to inherit from Entity class #1

Merged
merged 2 commits into from
Feb 19, 2024
Merged

Conversation

HokageM
Copy link
Owner

@HokageM HokageM commented Feb 19, 2024

The Hive class has been refactored to inherit from the Entity class. This allows for better code organization and separation of concerns. The Hive class now has an additional parameter in its constructor to accept a world object. The world object is used to access the map and other entities in the world. The print_hive_status method has been renamed to print_world_status and now accepts the world map, number of found food sources, and total food sources as parameters. The add_food_source method has been modified to ensure that the food source is not placed at the same position as the hive. The forage method has been simplified to remove the unnecessary iteration parameter and the map update logic has been moved to the Animator class.

The Hive class has been refactored to inherit from the Entity class. This allows for better code organization and separation of concerns. The Hive class now has an additional parameter in its constructor to accept a world object. The world object is used to access the map and other entities in the world. The print_hive_status method has been renamed to print_world_status and now accepts the world map, number of found food sources, and total food sources as parameters. The add_food_source method has been modified to ensure that the food source is not placed at the same position as the hive. The forage method has been simplified to remove the unnecessary iteration parameter and the map update logic has been moved to the Animator class.
@HokageM HokageM self-assigned this Feb 19, 2024
@HokageM HokageM merged commit 8bebac5 into main Feb 19, 2024
1 check passed
@HokageM HokageM deleted the world_map-1 branch February 19, 2024 22:38
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.

1 participant