Push up Path methods up the class hierarchy

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

  1. @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. You missed a space on the third line, won't get accepted!
     
  3. Where?
     
  4. The return after WebPath)

    1. else if (path instanceof WebPath)return ((WebPath) path).getNext().getPosition().minimap();
     
    Geashaw likes this.
  5. I'm not entirely sure if I should add them but I'll consider it.
     
  6. What's the point of the interface except to abstract away common methods?
     
  7. 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...