From: kos p. <kos...@gm...> - 2008-11-10 10:11:05
|
composition is better than subclassing, because your design is fixed by using subclassing, and I would prefer freedom. I would keep it simple by using only PrivateCompany and Company. In Company you can use an enum for the specific types if desired, and methods like isCoalCompany() etc. You don't need a TokenCompany, only a token on the stockmarket. The token references the corresponding company. 2008/11/10 <rai...@li...> > Send Rails-devel mailing list submissions to > rai...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/rails-devel > or, via email, send a message with subject or body 'help' to > rai...@li... > > You can reach the person managing the list at > rai...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rails-devel digest..." > > > Today's Topics: > > 1. Re: Bugs fixed (Mark Smith) > 2. Re: Bugs fixed (Erik Vos) > 3. Re: Bugs fixed (Mark Smith) > 4. Status of Tile & Map Code Integration (Mark Smith) > 5. Re: Status of Tile & Map Code Integration (brett lentz) > 6. Re: Status of Tile & Map Code Integration (Mark Smith) > 7. Re: Status of Tile & Map Code Integration (John A. Tamplin) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sat, 8 Nov 2008 21:03:42 -0500 > From: "Mark Smith" <mar...@gm...> > Subject: Re: [Rails-devel] Bugs fixed > To: "Development list for Rails: an 18xx game" > <rai...@li...> > Message-ID: > <314...@ma...> > Content-Type: text/plain; charset=ISO-8859-1 > > Erik, > > Your Note: > > > 2. No 2 yellow tiles allowed in 1851 from phase 3. Also relevant to 1835 > > (major companies, phase 2) and 1870 (all phases). It was caused by the > > introduction of a more complex XML structure for this feature with 18EU, > > which was not retrofitted to these other games. > > Implies that you fixed the bug report [1945675 1851 no multiple > track lays] - If you can confirm this, and update the bug report, I > can stop wondering if I should go and try and fix it. > > Thanks > Mark > > > > ------------------------------ > > Message: 2 > Date: Sun, 9 Nov 2008 19:44:24 +0100 > From: "Erik Vos" <eri...@hc...> > Subject: Re: [Rails-devel] Bugs fixed > To: "'Development list for Rails: an 18xx game'" > <rai...@li...> > Message-ID: <0D550664230C48228B63EFB8AEB986E2@ERIKVOS4> > Content-Type: text/plain; charset="us-ascii" > > OK, I have recorded the fix in the bug report. > Erik. > > > -----Original Message----- > > From: Mark Smith [mailto:mar...@gm...] > > Sent: Sunday 09 November 2008 03:04 > > To: Development list for Rails: an 18xx game > > Subject: Re: [Rails-devel] Bugs fixed > > > > Erik, > > > > Your Note: > > > > > 2. No 2 yellow tiles allowed in 1851 from phase 3. Also > > relevant to 1835 > > > (major companies, phase 2) and 1870 (all phases). It was > > caused by the > > > introduction of a more complex XML structure for this > > feature with 18EU, > > > which was not retrofitted to these other games. > > > > Implies that you fixed the bug report [1945675 1851 > > no multiple > > track lays] - If you can confirm this, and update the bug report, I > > can stop wondering if I should go and try and fix it. > > > > Thanks > > Mark > > > > -------------------------------------------------------------- > > ----------- > > This SF.Net email is sponsored by the Moblin Your Move > > Developer's challenge > > Build the coolest Linux based applications with Moblin SDK & > > win great prizes > > Grand prize is a trip for two to an Open Source event > > anywhere in the world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > ------------------------------ > > Message: 3 > Date: Sun, 9 Nov 2008 15:35:47 -0500 > From: "Mark Smith" <mar...@gm...> > Subject: Re: [Rails-devel] Bugs fixed > To: "Development list for Rails: an 18xx game" > <rai...@li...> > Message-ID: > <314...@ma...> > Content-Type: text/plain; charset=ISO-8859-1 > > Thanks Erik. > > On Sun, Nov 9, 2008 at 1:44 PM, Erik Vos <eri...@hc...> wrote: > > OK, I have recorded the fix in the bug report. > > Erik. > > > >> -----Original Message----- > >> From: Mark Smith [mailto:mar...@gm...] > >> Sent: Sunday 09 November 2008 03:04 > >> To: Development list for Rails: an 18xx game > >> Subject: Re: [Rails-devel] Bugs fixed > >> > >> Erik, > >> > >> Your Note: > >> > >> > 2. No 2 yellow tiles allowed in 1851 from phase 3. Also > >> relevant to 1835 > >> > (major companies, phase 2) and 1870 (all phases). It was > >> caused by the > >> > introduction of a more complex XML structure for this > >> feature with 18EU, > >> > which was not retrofitted to these other games. > >> > >> Implies that you fixed the bug report [1945675 1851 > >> no multiple > >> track lays] - If you can confirm this, and update the bug report, I > >> can stop wondering if I should go and try and fix it. > >> > >> Thanks > >> Mark > >> > >> -------------------------------------------------------------- > >> ----------- > >> This SF.Net email is sponsored by the Moblin Your Move > >> Developer's challenge > >> Build the coolest Linux based applications with Moblin SDK & > >> win great prizes > >> Grand prize is a trip for two to an Open Source event > >> anywhere in the world > >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ > >> _______________________________________________ > >> Rails-devel mailing list > >> Rai...@li... > >> https://lists.sourceforge.net/lists/listinfo/rails-devel > >> > > > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > > Build the coolest Linux based applications with Moblin SDK & win great > prizes > > Grand prize is a trip for two to an Open Source event anywhere in the > world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > ------------------------------ > > Message: 4 > Date: Sun, 9 Nov 2008 15:50:31 -0500 > From: "Mark Smith" <mar...@gm...> > Subject: [Rails-devel] Status of Tile & Map Code Integration > To: "Rails Dev Mailing List" <rai...@li...> > Message-ID: > <314...@ma...> > Content-Type: text/plain; charset=ISO-8859-1 > > I have been working this weekend to bring my collection of various > classes into my copy of Rails under two sub-packages > 'rails.ui.swing.revenucenters' and 'rails.ui.swing.tiles'. I have been > updating to get them to compile, and use the 'Tag' class to load data > from data files. I expect that I have about 3-4 more classes to go > before I can actually draw the Tile Tray properly. > > I was looking at the current copies of 'Company', 'PublicCompany', > 'PrivateCompany' and I would like to ask another question. > > I see a Company Class hierarchy as follows: > > public class Company; > > public class PrivateCompany extends Company; // A Company that has no > train, no tokens, and no tile-laying capability > > public class TrainCompany extends Company; // A Company that can hold > one or more trains and can lay track > > public class CoalCompany extends TrainCompany; // A TrainCompany that > has no Tokens (1837) > > public class TokenCompany extends TrainCompany; // A TrainCompany that > has one or more Tokens > > public class MinorCompany extends TokenCompany; // A TokenCompany that > is a Minor company with Certificates, but has a fixed share price > > public class ShareCompany extends TokenCompany; // A TokenCompany that > is a Major company with Certificates that has flexible price based on > the Market > > This could be extended to a SystemCompany that contains two > ShareCompanies. (1832) > > Does a structure like this make sense to you folks? > > Mark > > > > ------------------------------ > > Message: 5 > Date: Sun, 9 Nov 2008 13:42:37 -0800 > From: "brett lentz" <wak...@gm...> > Subject: Re: [Rails-devel] Status of Tile & Map Code Integration > To: "Development list for Rails: an 18xx game" > <rai...@li...> > Message-ID: > <c69...@ma...> > Content-Type: text/plain; charset=ISO-8859-1 > > On Sun, Nov 9, 2008 at 12:50 PM, Mark Smith <mar...@gm...> > wrote: > > I have been working this weekend to bring my collection of various > > classes into my copy of Rails under two sub-packages > > 'rails.ui.swing.revenucenters' and 'rails.ui.swing.tiles'. I have been > > updating to get them to compile, and use the 'Tag' class to load data > > from data files. I expect that I have about 3-4 more classes to go > > before I can actually draw the Tile Tray properly. > > > > Mark > > > > Revenue should have an "e" at the end of it. :-) > > > ---Brett. > > > > ------------------------------ > > Message: 6 > Date: Sun, 9 Nov 2008 18:13:00 -0500 > From: "Mark Smith" <mar...@gm...> > Subject: Re: [Rails-devel] Status of Tile & Map Code Integration > To: "Development list for Rails: an 18xx game" > <rai...@li...> > Message-ID: > <314...@ma...> > Content-Type: text/plain; charset=ISO-8859-1 > > Yes, of course it does. I have it correct in the code base. I made a > typo in the e-mail. > > On Sun, Nov 9, 2008 at 4:42 PM, brett lentz <wak...@gm...> wrote: > > On Sun, Nov 9, 2008 at 12:50 PM, Mark Smith <mar...@gm...> > wrote: > >> I have been working this weekend to bring my collection of various > >> classes into my copy of Rails under two sub-packages > >> 'rails.ui.swing.revenucenters' and 'rails.ui.swing.tiles'. I have been > >> updating to get them to compile, and use the 'Tag' class to load data > >> from data files. I expect that I have about 3-4 more classes to go > >> before I can actually draw the Tile Tray properly. > >> > >> Mark > >> > > > > Revenue should have an "e" at the end of it. :-) > > > > > > ---Brett. > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > > Build the coolest Linux based applications with Moblin SDK & win great > prizes > > Grand prize is a trip for two to an Open Source event anywhere in the > world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > ------------------------------ > > Message: 7 > Date: Sun, 09 Nov 2008 18:29:01 -0500 > From: "John A. Tamplin" <ja...@ja...> > Subject: Re: [Rails-devel] Status of Tile & Map Code Integration > To: Development list for Rails: an 18xx game > <rai...@li...> > Message-ID: <491...@ja...> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Mark Smith wrote: > > I was looking at the current copies of 'Company', 'PublicCompany', > > 'PrivateCompany' and I would like to ask another question. > > > > I see a Company Class hierarchy as follows: > > > > public class Company; > > > > public class PrivateCompany extends Company; // A Company that has no > > train, no tokens, and no tile-laying capability > > > > public class TrainCompany extends Company; // A Company that can hold > > one or more trains and can lay track > > > > public class CoalCompany extends TrainCompany; // A TrainCompany that > > has no Tokens (1837) > > > > public class TokenCompany extends TrainCompany; // A TrainCompany that > > has one or more Tokens > > > > public class MinorCompany extends TokenCompany; // A TokenCompany that > > is a Minor company with Certificates, but has a fixed share price > > > > public class ShareCompany extends TokenCompany; // A TokenCompany that > > is a Major company with Certificates that has flexible price based on > > the Market > > > > This could be extended to a SystemCompany that contains two > > ShareCompanies. (1832) > > > > Does a structure like this make sense to you folks? > > > There are so many variations on these in different games, I don't think > it makes sense to codify the capabilities in the class hierarchy. For > example, some minor companies do have stock prices, and some Coal > companies do have tokens (1824). I think it is better to have a general > Company that gets flags at creation time, and when it is created to fill > a particular role those flags are set appropriately according to the > game. You also have to consider company transformations during the > game, and it seems easiest if it is just one company and you change the > capabilities when it transforms. > > -- > John A. Tamplin ja...@ja... > 770/436-5387 HOME 4116 Manson Ave > Smyrna, GA 30082-3723 > > > > > ------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > ------------------------------ > > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > End of Rails-devel Digest, Vol 20, Issue 8 > ****************************************** > |