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:
    590
    Likes Received:
    236
    @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,019
    Likes Received:
    174
    You missed a space on the third line, won't get accepted!
     
  3. Exia

    Joined:
    Nov 3, 2013
    Messages:
    590
    Likes Received:
    236
    Where?
     
  4. valithor

    Joined:
    Apr 13, 2015
    Messages:
    8
    Likes Received:
    1
    The return after WebPath)

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

    Cloud The Developer

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

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

    Cloud The Developer

    Joined:
    Jul 28, 2013
    Messages:
    2,310
    Likes Received:
    739
    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...