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

toDirection Method of MapLocation is Non-static #260

Open
kalpshah18 opened this issue Jan 10, 2021 · 1 comment
Open

toDirection Method of MapLocation is Non-static #260

kalpshah18 opened this issue Jan 10, 2021 · 1 comment
Assignees
Labels

Comments

@kalpshah18
Copy link

The toDirection Method which takes a Map Location in as a parameter is a non static method so it cannot be used in our Robots as they use static methods. If we use a non - static run method then it may not work in the competition. Please add the static keyword to the method.

@j-mao j-mao added the engine label Jan 11, 2021
@j-mao j-mao self-assigned this Jan 11, 2021
@j-mao
Copy link
Member

j-mao commented Jan 11, 2021

Hi @protrooper, thanks for the message! We believe it wouldn't make sense to make the directionTo method static, as it depends on the actual MapLocation object you're querying. To be precise, we would expect you to be calling someLocation.directionTo(someOtherLocation), rather than MapLocation.directionTo(someOtherLocation).

If you are hoping to find the direction to a location from your current location, then you should instead start by retrieving your current location, and using rc.getLocation().directionTo(someOtherLocation).

Please let us know if this resolves your issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants