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

Introduce harvesting logic and first steps to State Machine #147

Merged
merged 18 commits into from May 2, 2017

Conversation

Projects
None yet
3 participants
@stefanhendriks
Contributor

stefanhendriks commented Oct 17, 2016

For #110

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Oct 17, 2016

Coverage Status

Coverage decreased (-0.8%) to 82.849% when pulling 682bf6c on harvester/harvesting-logic into eb54a07 on master.

coveralls commented Oct 17, 2016

Coverage Status

Coverage decreased (-0.8%) to 82.849% when pulling 682bf6c on harvester/harvesting-logic into eb54a07 on master.

harvester unit determined by entityData (which is still hard coded by…
… ID) + when selecting one or multiple harvesters then show 'attack' image on harvestable cells
@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Oct 17, 2016

Coverage Status

Coverage decreased (-1.09%) to 82.588% when pulling d9afb14 on harvester/harvesting-logic into eb54a07 on master.

coveralls commented Oct 17, 2016

Coverage Status

Coverage decreased (-1.09%) to 82.588% when pulling d9afb14 on harvester/harvesting-logic into eb54a07 on master.

@stefanhendriks

This comment has been minimized.

Show comment
Hide comment
@stefanhendriks

stefanhendriks Oct 17, 2016

Contributor

Harvesting logic is very primitive. Only animation works for now:
harvesting_animation
/cc @arjenvanderende

Contributor

stefanhendriks commented Oct 17, 2016

Harvesting logic is very primitive. Only animation works for now:
harvesting_animation
/cc @arjenvanderende

@stefanhendriks

This comment has been minimized.

Show comment
Hide comment
@stefanhendriks

stefanhendriks Oct 19, 2016

Contributor

State machine logic! (/cc @arjenvanderende)
harvesting_state_machine_high_quality

Contributor

stefanhendriks commented Oct 19, 2016

State machine logic! (/cc @arjenvanderende)
harvesting_state_machine_high_quality

@arjenvanderende

This comment has been minimized.

Show comment
Hide comment
@arjenvanderende
Collaborator

arjenvanderende commented Oct 19, 2016

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Oct 19, 2016

Coverage Status

Coverage decreased (-1.1%) to 82.565% when pulling afa8351 on harvester/harvesting-logic into eb54a07 on master.

coveralls commented Oct 19, 2016

Coverage Status

Coverage decreased (-1.1%) to 82.565% when pulling afa8351 on harvester/harvesting-logic into eb54a07 on master.

moveTo(target);
}
private void setState(UnitState state) {

This comment has been minimized.

@stefanhendriks

stefanhendriks Oct 19, 2016

Contributor

@arjenvanderende look... I had to add this if statement to make sure things kept working.

I think it is mostly due the limbo state between state machine and non-state machine pattern currently within the unit (as it would 'set state' in every update cycle, ie see harvesting call being called in the update method).

@stefanhendriks

stefanhendriks Oct 19, 2016

Contributor

@arjenvanderende look... I had to add this if statement to make sure things kept working.

I think it is mostly due the limbo state between state machine and non-state machine pattern currently within the unit (as it would 'set state' in every update cycle, ie see harvesting call being called in the update method).

This comment has been minimized.

@arjenvanderende

arjenvanderende Oct 19, 2016

Collaborator

It seems to me like we're guided to remove all logic from Unit#update to the relevant state machine classes. Checks like :

if (hitPointBasedDestructibility.hasDied()) {
  die();
}

should be moved as well (using a default implementation for State#Update?).

I think we need to strive state-changes to only be triggered by states (instead of external factor). Though we cannot prevent this in all cases (like mouse-click to attack). What do you think?

@arjenvanderende

arjenvanderende Oct 19, 2016

Collaborator

It seems to me like we're guided to remove all logic from Unit#update to the relevant state machine classes. Checks like :

if (hitPointBasedDestructibility.hasDied()) {
  die();
}

should be moved as well (using a default implementation for State#Update?).

I think we need to strive state-changes to only be triggered by states (instead of external factor). Though we cannot prevent this in all cases (like mouse-click to attack). What do you think?

This comment has been minimized.

@stefanhendriks

stefanhendriks Oct 28, 2016

Contributor

yes, certain 'events' will trigger stage changes. Events can be mouse-click, or emitted by another state.

I tried moving the current 'move' logic into a movestate object, but failed. I need to rethink it and try again probably. As it would make 'harvester entering a structure' easier I think.

@stefanhendriks

stefanhendriks Oct 28, 2016

Contributor

yes, certain 'events' will trigger stage changes. Events can be mouse-click, or emitted by another state.

I tried moving the current 'move' logic into a movestate object, but failed. I need to rethink it and try again probably. As it would make 'harvester entering a structure' easier I think.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Oct 22, 2016

Coverage Status

Coverage decreased (-1.1%) to 82.565% when pulling 8035827 on harvester/harvesting-logic into eb54a07 on master.

coveralls commented Oct 22, 2016

Coverage Status

Coverage decreased (-1.1%) to 82.565% when pulling 8035827 on harvester/harvesting-logic into eb54a07 on master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Oct 28, 2016

Coverage Status

Coverage decreased (-1.1%) to 82.565% when pulling 9ebfaaa on harvester/harvesting-logic into fa694e8 on master.

coveralls commented Oct 28, 2016

Coverage Status

Coverage decreased (-1.1%) to 82.565% when pulling 9ebfaaa on harvester/harvesting-logic into fa694e8 on master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Nov 1, 2016

Coverage Status

Coverage decreased (-1.06%) to 82.617% when pulling 0629780 on harvester/harvesting-logic into fa694e8 on master.

coveralls commented Nov 1, 2016

Coverage Status

Coverage decreased (-1.06%) to 82.617% when pulling 0629780 on harvester/harvesting-logic into fa694e8 on master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Nov 4, 2016

Coverage Status

Coverage decreased (-1.06%) to 82.617% when pulling b30d99d on harvester/harvesting-logic into 5735eea on master.

coveralls commented Nov 4, 2016

Coverage Status

Coverage decreased (-1.06%) to 82.617% when pulling b30d99d on harvester/harvesting-logic into 5735eea on master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Mar 31, 2017

Coverage Status

Coverage decreased (-1.06%) to 82.617% when pulling a154dc4 on harvester/harvesting-logic into caea21f on master.

coveralls commented Mar 31, 2017

Coverage Status

Coverage decreased (-1.06%) to 82.617% when pulling a154dc4 on harvester/harvesting-logic into caea21f on master.

Fix bug, whenever a unit was moving, and ordered to move to a differe…
…nt vector, then do not block on self-claimed vectors.

- add tests for UnitMoveIntents to secure this behavior
- add an idle behavior/state
@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Mar 31, 2017

Coverage Status

Coverage decreased (-1.06%) to 82.612% when pulling 85d34bd on harvester/harvesting-logic into caea21f on master.

coveralls commented Mar 31, 2017

Coverage Status

Coverage decreased (-1.06%) to 82.612% when pulling 85d34bd on harvester/harvesting-logic into caea21f on master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Apr 1, 2017

Coverage Status

Coverage decreased (-1.06%) to 82.612% when pulling b40f513 on harvester/harvesting-logic into caea21f on master.

coveralls commented Apr 1, 2017

Coverage Status

Coverage decreased (-1.06%) to 82.612% when pulling b40f513 on harvester/harvesting-logic into caea21f on master.

When unit is ordered mid-way, make sure it completes its movement to the
current cell and then re-evaluates where to go
@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Apr 1, 2017

Coverage Status

Coverage decreased (-0.9%) to 82.796% when pulling 5adc4c9 on harvester/harvesting-logic into caea21f on master.

coveralls commented Apr 1, 2017

Coverage Status

Coverage decreased (-0.9%) to 82.796% when pulling 5adc4c9 on harvester/harvesting-logic into caea21f on master.

@stefanhendriks stefanhendriks referenced this pull request Apr 1, 2017

Closed

Ability to harvest & earn credits #110

15 of 20 tasks complete

@stefanhendriks stefanhendriks changed the title from Harvesting logic to Introduce harvesting logic and first steps to State Machine Apr 1, 2017

@stefanhendriks

This comment has been minimized.

Show comment
Hide comment
@stefanhendriks

stefanhendriks Apr 1, 2017

Contributor

@arjenvanderende squished two bugs regarding unit movement. Looks like it behaves like before.

Still lots of loose ends, but I'm thinking about merging this and opening new PR's for the loose ends.

Contributor

stefanhendriks commented Apr 1, 2017

@arjenvanderende squished two bugs regarding unit movement. Looks like it behaves like before.

Still lots of loose ends, but I'm thinking about merging this and opening new PR's for the loose ends.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Apr 10, 2017

Coverage Status

Coverage decreased (-0.9%) to 82.802% when pulling c633703 on harvester/harvesting-logic into caea21f on master.

coveralls commented Apr 10, 2017

Coverage Status

Coverage decreased (-0.9%) to 82.802% when pulling c633703 on harvester/harvesting-logic into caea21f on master.

@stefanhendriks stefanhendriks merged commit 9df8b4f into master May 2, 2017

3 of 4 checks passed

codacy/pr Not so good... This pull request quality could be better.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.006%) to 82.802%
Details

@stefanhendriks stefanhendriks deleted the harvester/harvesting-logic branch May 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment