From: <wak...@ea...> - 2005-04-28 20:23:30
|
>> It looks like Certificate is being used in the PublicCompany >> class, among others. Is there any reason I should not just >> remove the Stock class? > Please do. Done. > When creating Certificate I did in fact overlook the existence > of Stock. I chose the name 'Certificate' deliberately to emphasize > its meaning in view of the explicit distinction between "Share" > and "Certificate" that all 18xx games make. No worries. Stock just had a bunch of stubs I'd created. The only problem was that Player was originally referencing those stubs for the buyShare and sellShare methods. I've fixed those to now reference Certificates instead. Also, they're no longer stubs, but actually working methods. :-D I've also created a PlayerManager to hold methods that don't really quite fit into the Player class itself, such as getPlayerByName(). It's not quite the same sort of singleton that the other managers are, but it uses many of the same conventions for the sake of consistency. >As for its attributes, I'm considering to replace "share" (the >percentage of ownership) by "shares" (the number of shares). >I've already added an attribute "shareUnit" to PublicCompany >(which is the percentage of ownership of "one share"). >Of course: "share" = "shares" * "shareUnit". Good call. This is much more scalable. ---Brett |