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

Fix some of the constants.ts todos #17

Merged
merged 2 commits into from Nov 16, 2017

Conversation

Projects
None yet
2 participants
@Arcath
Contributor

Arcath commented Nov 14, 2017

This PR fixes the TODO's in constants.ts. Aiming to bundle these changes in #16.

  1. define OBSTACLE_OBJECT_TYPES instead of using string[]
  2. Introduce BuildableStructureConstant which is a subset of StructureConstant. I've used it where needed so that tyepscript will report errors correctly (e.g. if someone wanted the construction cost of STRUCTURE_PORTAL etc...)

Still to do:

  • Reactions
  • Boosts

Reactions and Boosts are currently typed so that they should work but they aren't strict.

I think it might be better to copy the definitions over from the screeps docs instead of trying to be smart with the typings.

Is a 5 line definition more important than having REACTIONS[RESOURCE_ENERGY][RESOURCE_ENERGY] not produce an error until runtime?

Arcath added some commits Nov 14, 2017

@Arcath

This comment has been minimized.

Contributor

Arcath commented Nov 15, 2017

This should be ready to pull now.

I've imported the full constants for REACTIONS and BOOSTS which should be good.

@resir014

This comment has been minimized.

Member

resir014 commented Nov 16, 2017

@Arcath This is perfect, thanks!!

@resir014 resir014 merged commit 6f91961 into screepers:2.0.0 Nov 16, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment