From: Erik V. <eri...@xs...> - 2011-08-16 19:53:52
|
I have added the following three methods to Stop: runThroughAllowedFor(company), runToAllowedFor(company), getValueForPhase (phase). These methods aren't used yet. I'm leaving getName() out for now, pending the discussion on looping and off-map areas. Neither did I change method visibilities yet. Erik. > -----Original Message----- > From: Erik Vos [mailto:eri...@xs...] > Sent: Monday, August 15, 2011 9:29 PM > To: 'Development list for Rails: an 18xx game' > Subject: Re: [Rails-devel] Stop properties > > > > > -----Original Message----- > > From: Stefan Frey [mailto:ste...@we...] > > Sent: Monday, August 15, 2011 6:25 PM > > To: Development list for Rails: an 18xx game > > Subject: Re: [Rails-devel] Stop properties > > > > Erik: > > I tried to change my coding in NetworkVertex accordingly. > > Thanks a lot this will simplify the previous code needed to adapt the > revenue > > code to the algorithm code substantially. > > > > However as usual with coding one realizes some more thing. > > > > I think having those attributes are one thing, checking if runThrough > > or > runTo > > is possible still requires more than that. > > > > The best solution would be adding additional methods for if a > > runThrough and a runTo is possible for a specific company. Thus it > > also checks the > current > > token situation. > > > > Thus something like > > > > public boolean runThroughAllowedFor(PublicCompanyI company) public > > boolean runToAllowedFor(PublicCompanyI company) > > Hmm, that does make sense. > > > >From my perspective you could then define the > > isRunToAllowed/isRunThroughAllowed for as private or even remove it, > > as this is only required internally. Similar for the according methods > > in > MapHex > > or Tile, they only need to be package private and not public. > > On the supposition that we will never subclass MapHex, Stop and Tile. But > that's indeed unlikely. > > > Even better would be if you could add similar methods. Then all > > values > are > > retrieved from the stop object, instead of sometimes querying hex or > station > > instead. > > > > * public int getValueAt(PhaseI phase) > > Retrieves the current value (either from the related station for > cities/towns > > or via the MapHex for offboard defined values) > > > > * public String getName() > > Retrieves the name: Either from the hex or if undefined there from the > > related station. > > > > Again this would allow to restrict access/visibility of a lot of > > related > methods > > in Stop / Station / MapHex. > > I think getName() must be public everywhere - it's used in many ways. > > Ok, this all should be doable, hopefully before I'm going on vacation next > week Wednesday for almost three weeks. During my vacation you probably > won't hear from me. > > Erik. > > > > > ---------------------------------------------------------------------------- -- > uberSVN's rich system and user administration capabilities and model > configuration take the hassle out of deploying and managing Subversion and > the tools developers use with it. Learn more about uberSVN and get a free > download at: http://p.sf.net/sfu/wandisco-dev2dev > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |