From: Erik V. <eri...@hc...> - 2005-04-28 19:01:31
|
> It looks like we've got a bit of duplication of code. > > There's a Stock class and there's a Certificate class. > > Other than the obvious difference in keystrokes, is there any > reason why they should both exist? > > 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. 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. 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". The reason is to facilitate the change of the percentage of ownership that one share represents, as happens in many games. For instance, in 1826 many companies start as a 5-share company, where the President's share represents 40% (2 shares of 20% each). Later 5 additional shares are issued, the President's share then becomes 20% (2 shares of 10%). So only the share unit changes. In 1856, the CGR share unit can be either 10% or 5%. Erik. |