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

Sensed space and sensed unit entities #129

Merged
merged 3 commits into from
May 20, 2018
Merged

Conversation

olistic
Copy link
Owner

@olistic olistic commented May 18, 2018

This PR introduces the entities SensedSpace and SensedUnit. Whenever a unit gets a space after sensing an area, one or multiple SensedSpace will be returned. This new object represents the space as it was perceived by the unit that sensed it. If there was a unit located at the space, that unit will be a SensedUnit. Methods called on these sensed entities are now be relative to the unit that sensed them:

  • space.getLocation(): returns the location of the space as the number of spaces forward and to the right of the unit that sensed it.
  • unit.isEnemy(): returns whether the unit is considered an enemy by the unit that sensed it.

@codecov-io
Copy link

codecov-io commented May 18, 2018

Codecov Report

Merging #129 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #129      +/-   ##
==========================================
+ Coverage    91.1%   91.13%   +0.03%     
==========================================
  Files          81       81              
  Lines        1045     1049       +4     
  Branches      167      168       +1     
==========================================
+ Hits          952      956       +4     
  Misses         77       77              
  Partials       16       16
Impacted Files Coverage Δ
packages/warriorjs-units/src/Captive.js 100% <ø> (ø) ⬆️
packages/warriorjs-abilities/src/look.js 100% <100%> (ø) ⬆️
packages/warriorjs-core/src/Level.js 100% <100%> (ø) ⬆️
packages/warriorjs-core/src/Unit.js 100% <100%> (ø) ⬆️
packages/warriorjs-abilities/src/feel.js 100% <100%> (ø) ⬆️
packages/warriorjs-core/src/Space.js 100% <100%> (ø) ⬆️
packages/warriorjs-units/src/Sludge.js 100% <100%> (ø) ⬆️
packages/warriorjs-units/src/Archer.js 100% <100%> (ø) ⬆️
packages/warriorjs-abilities/src/listen.js 100% <100%> (ø) ⬆️
packages/warriorjs-core/src/Position.js 100% <100%> (ø) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6289b4b...f2888fb. Read the comment docs.

@olistic olistic force-pushed the sensed-spaces-and-units branch 12 times, most recently from 642219e to 18a03b1 Compare May 19, 2018 20:39
@olistic olistic changed the title Sensed spaces and units Sensed space and sensed unit entities May 19, 2018
@olistic olistic force-pushed the sensed-spaces-and-units branch 2 times, most recently from ccf82a0 to e1a3f84 Compare May 19, 2018 22:09
@olistic olistic force-pushed the sensed-spaces-and-units branch 2 times, most recently from c68debe to d0059e2 Compare May 20, 2018 00:24
@olistic olistic merged commit b12387e into master May 20, 2018
@olistic olistic deleted the sensed-spaces-and-units branch May 20, 2018 01:37
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.

None yet

2 participants