-
Notifications
You must be signed in to change notification settings - Fork 206
Pack all units #257
Pack all units #257
Conversation
IIRC historically, we only packed a subset of units, and those subsets had different criteria for ally/enemy/neutral (which were more complex than what's in there now). Yeah, we can just pack all. |
void Controller::packUnits(replayer::Frame& f) { | ||
for (auto& u : BWAPI::Broodwar->getAllUnits()) { | ||
if (u->getPlayer() == nullptr) | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit indent
u, | ||
f, | ||
BWAPI::Broodwar->neutral()); // TODO: only when the state changes | ||
addUnit(u, f, u->getPlayer()); // TODO: only when the state changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this TODO? This is taken care of by frame diffs.
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
// Ignore the unit if it no longer exists | ||
void Controller::packUnits(replayer::Frame& f) { | ||
for (auto& u : BWAPI::Broodwar->getAllUnits()) { | ||
if (u->getPlayer() == nullptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When do we expect this to be true?
Is there any reason we don't pack units for all players in non-replays? @jgehring