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

Improve RobotPool encapsulation for command limit #1335

Open
DanRStevens opened this issue May 4, 2023 · 1 comment
Open

Improve RobotPool encapsulation for command limit #1335

DanRStevens opened this issue May 4, 2023 · 1 comment

Comments

@DanRStevens
Copy link
Member

Having a public method for RobotPool::AddRobotCtrl seems to break encapsulation. This sort of detail should be made private.

It would seem to make sense to do any such check inside RobotPool::insertRobotIntoTable.

Additionally, we probably want to add a hard check on the robot limit to the start of RobotPool::insertRobotIntoTable before allowing an active robot to be placed on the map.

The command limit is on the number of active robots. Any additional robots would sit in storage, provided there is storage space available. Robots beyond the command limit, and with no storage to hold them, would be destroyed and removed from the game.

Related Issue: #1311

@DanRStevens
Copy link
Member Author

More deeply, having the RobotTileTable owned by MapViewState rather than by RobotPool also seems to break encapsulation.

It seems RobotPool is used to managed both the pool of robots sitting in storage, and the actively deployed and operating robots. For RobotPool to accurately track active robot deployments, and limit deployments to the current active cap, we should probably transfer ownership of the RobotTileTable to RobotPool.

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

No branches or pull requests

1 participant