1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Push up Path methods up the class hierarchy

Discussion in 'Client & Site Suggestions' started by Exia, May 2, 2015.

  1. Exia

    Joined:
    Nov 3, 2013
    Messages:
    609
    Likes Received:
    259
    @Cloud @Arbiter
    Can you push the next() and generationTime() methods up into the Path class? Otherwise I have to do this:
    Code (Text):
    1. Path path = pathBuilder.build(Players.getLocal(), bank.getArea());
    2. if(path instanceof RegionPath) return ((RegionPath) path).getNext().getPosition().minimap();
    3. else if (path instanceof WebPath)return ((WebPath) path).getNext().getPosition().minimap();
    Which seems a bit silly :(
     
    #1 Exia, May 2, 2015
    Last edited: May 2, 2015
  2. Geashaw

    Joined:
    Jan 8, 2015
    Messages:
    1,429
    Likes Received:
    252
    You missed a space on the third line, won't get accepted!
     
  3. Exia

    Joined:
    Nov 3, 2013
    Messages:
    609
    Likes Received:
    259
    Where?
     
  4. valithor

    Joined:
    Apr 13, 2015
    Messages:
    31
    Likes Received:
    10
    The return after WebPath)

    1. else if (path instanceof WebPath)return ((WebPath) path).getNext().getPosition().minimap();
     
    Geashaw likes this.
  5. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    I'm not entirely sure if I should add them but I'll consider it.
     
  6. Exia

    Joined:
    Nov 3, 2013
    Messages:
    609
    Likes Received:
    259
    What's the point of the interface except to abstract away common methods?
     
  7. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    I've gone ahead and added getNext to Path, but I haven't added get generation time because it's not always something that's available.
     
    Exia likes this.

Share This Page

Loading...