Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Pack all units #257

Merged
merged 1 commit into from
Jul 19, 2019
Merged

Pack all units #257

merged 1 commit into from
Jul 19, 2019

Conversation

ebetica
Copy link
Contributor

@ebetica ebetica commented Apr 17, 2018

Is there any reason we don't pack units for all players in non-replays? @jgehring

@jgehring
Copy link
Member

jgehring commented Apr 17, 2018

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;
Copy link
Member

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
Copy link
Member

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.

@facebook-github-bot
Copy link
Contributor

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!

@facebook-github-bot
Copy link
Contributor

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)
Copy link
Contributor

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?

@ebetica ebetica merged commit c336c08 into develop Jul 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants