Skip to content

toDirection Method of MapLocation is Non-static #260

Open

Description

@kalpshah18

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.

Activity

  1. self-assigned this
    on Jan 11, 2021
  2. j-mao commented on Jan 11, 2021

    @j-mao
    Member

    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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions