You can subscribe to this list here.
2005 |
Jan
|
Feb
(25) |
Mar
(84) |
Apr
(76) |
May
(25) |
Jun
(1) |
Jul
(28) |
Aug
(23) |
Sep
(50) |
Oct
(46) |
Nov
(65) |
Dec
(76) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(60) |
Feb
(33) |
Mar
(4) |
Apr
(17) |
May
(16) |
Jun
(18) |
Jul
(131) |
Aug
(11) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(5) |
2007 |
Jan
(71) |
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
(19) |
Jul
(40) |
Aug
(38) |
Sep
(7) |
Oct
(58) |
Nov
|
Dec
(10) |
2008 |
Jan
(17) |
Feb
(27) |
Mar
(12) |
Apr
(1) |
May
(50) |
Jun
(10) |
Jul
|
Aug
(15) |
Sep
(24) |
Oct
(64) |
Nov
(115) |
Dec
(47) |
2009 |
Jan
(30) |
Feb
(1) |
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
(4) |
Nov
(132) |
Dec
(93) |
2010 |
Jan
(266) |
Feb
(120) |
Mar
(168) |
Apr
(127) |
May
(83) |
Jun
(93) |
Jul
(77) |
Aug
(77) |
Sep
(86) |
Oct
(30) |
Nov
(4) |
Dec
(22) |
2011 |
Jan
(48) |
Feb
(81) |
Mar
(198) |
Apr
(174) |
May
(72) |
Jun
(101) |
Jul
(236) |
Aug
(144) |
Sep
(54) |
Oct
(132) |
Nov
(94) |
Dec
(111) |
2012 |
Jan
(135) |
Feb
(166) |
Mar
(86) |
Apr
(85) |
May
(137) |
Jun
(83) |
Jul
(54) |
Aug
(29) |
Sep
(49) |
Oct
(37) |
Nov
(8) |
Dec
(6) |
2013 |
Jan
(2) |
Feb
|
Mar
(1) |
Apr
(14) |
May
(5) |
Jun
(15) |
Jul
|
Aug
(38) |
Sep
(44) |
Oct
(45) |
Nov
(40) |
Dec
(23) |
2014 |
Jan
(22) |
Feb
(63) |
Mar
(43) |
Apr
(60) |
May
(10) |
Jun
(5) |
Jul
(13) |
Aug
(57) |
Sep
(36) |
Oct
(2) |
Nov
(30) |
Dec
(27) |
2015 |
Jan
(5) |
Feb
(2) |
Mar
(14) |
Apr
(3) |
May
|
Jun
(3) |
Jul
(10) |
Aug
(63) |
Sep
(31) |
Oct
(26) |
Nov
(11) |
Dec
(6) |
2016 |
Jan
|
Feb
(11) |
Mar
|
Apr
|
May
(1) |
Jun
(16) |
Jul
|
Aug
(4) |
Sep
|
Oct
(1) |
Nov
(4) |
Dec
(1) |
2017 |
Jan
(2) |
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
(20) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(10) |
May
(10) |
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(3) |
Apr
(9) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
(4) |
2021 |
Jan
(5) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
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 > ****************************************** > |
From: John A. T. <ja...@ja...> - 2008-11-10 06:45:36
|
Mark Smith wrote: > When I came up with my hierarchy I was primarily focused on the games > I currently own (1829, 1830, 1835, 1837, 1853, 1856, 1870). And since > then many more sprang up. I do still feel building a basic hierarchy > for companies makes sense. It allows separation of functionality. and > allows the class hierarchy enforce some of the game mechanics (a > company that is just a Train Company, cannot manipulate tokens, and if > a Company is a Token Company, but not a Share Company cannot have > certificates that have variable price). But I would be interested in > what Brett & Erik have to say on the subject. I am sure they have > discussed this in the past. > The problem is there are a large number of variations and more will be added over time. Assume you have n different criteria you want to encode in the class hierarchy (exists on the map, has tokens, has a share price, may merge, etc). If you encode all possibilities into the hierarchy, you wind up with n^m classes, most of which are very similar. If instead you expose these different functions into separate classes and have the company delegate to them depending on what form it currently has, you have only n*m classes with no code duplication. Again think of the idea of Rails being to core code to implement any game and the per-game files would contain only unique code needed for that game. If a new game requires a new combination of these features in a company, the only option would be to duplicate lots of in-Rails code in the game-specific classes, which worsens the maintenance burden especially when they may have separate maintainers. -- John A. Tamplin ja...@ja... 770/436-5387 HOME 4116 Manson Ave Smyrna, GA 30082-3723 |
From: Mark S. <mar...@gm...> - 2008-11-10 01:04:38
|
Possibly my branches of a CoalCompany, and a MinorCompany are not required, given that some games (like 1824 allow a Coal Company to have Tokens, and 1837 provide no tokens to a Coal Company), and a Minor Company sometimes has a fixed-price, and sometimes a variable price. I just hate huge classes that distinguish based on flags. I do see that in the case of 1841 a company can start as a Minor or a Major Company. In this example, I would probably just keep these both as a ShareCompany, with a type flag set at creation time. With regards to transformations, examples being: 1. Minor Companies in 1824, 1835, 1837 merge to a Share Company, 2. 1856 where Share Companies in debt merge to the CGR, 3. Coal Companies in 1824 and 1837 are exchanged to other company shares 4. 1832 two major companies merge to a System I am sure there are more variations to this. I do see each of these transformations as more of an exchange of shares (except for the 1832 System creation). Trying to simply change the capabilities when it transforms is I feel the wrong approach. It makes an undo that much harder to accomplish. Besides, the exchanges don't all happen at the same time (Coal Company Certificate exchange at the owner's discretion, or Phase change requirement). When I came up with my hierarchy I was primarily focused on the games I currently own (1829, 1830, 1835, 1837, 1853, 1856, 1870). And since then many more sprang up. I do still feel building a basic hierarchy for companies makes sense. It allows separation of functionality. and allows the class hierarchy enforce some of the game mechanics (a company that is just a Train Company, cannot manipulate tokens, and if a Company is a Token Company, but not a Share Company cannot have certificates that have variable price). But I would be interested in what Brett & Erik have to say on the subject. I am sure they have discussed this in the past. |
From: John A. T. <ja...@ja...> - 2008-11-09 23:29:07
|
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 |
From: Mark S. <mar...@gm...> - 2008-11-09 23:13:11
|
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 > |
From: brett l. <wak...@gm...> - 2008-11-09 21:50:46
|
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. |
From: Mark S. <mar...@gm...> - 2008-11-09 20:50:38
|
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 |
From: Mark S. <mar...@gm...> - 2008-11-09 20:35:54
|
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 > |
From: Erik V. <eri...@hc...> - 2008-11-09 18:44:18
|
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 > |
From: Mark S. <mar...@gm...> - 2008-11-09 02:03:48
|
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 |
From: brett l. <wak...@gm...> - 2008-11-08 20:00:55
|
On Sat, Nov 8, 2008 at 3:57 AM, kos petoussis <kos...@gm...> wrote: > how do i connect with eclipse to rails? > it says connection refused if i use anonymous > Just follow the instructions located here: https://sourceforge.net/cvs/?group_id=132173 Fill out the Eclipse form with the information listed. ---Brett. |
From: Mark S. <mar...@gm...> - 2008-11-08 15:59:24
|
Why I see these singletons as effectively global variables is because the way you have it set up, where you can call (for example) the GameManager.getInstance () static routine from anywhere in the code base, allows for the GameManager class to be accessed and manipulated from anywhere. There is no true "encapsulation" enforced. The getInstance method allows any code to muck around with stuff it shouldn't know or care about. Mark |
From: Mark S. <mar...@gm...> - 2008-11-08 14:28:53
|
Erik and Brett are using Eclipse so they would have a better answer then me. Sorry. Mark On Sat, Nov 8, 2008 at 6:57 AM, kos petoussis <kos...@gm...> wrote: > how do i connect with eclipse to rails? > it says connection refused if i use anonymous > > ------------------------------------------------------------------------- > 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 > > |
From: kos p. <kos...@gm...> - 2008-11-08 11:57:13
|
how do i connect with eclipse to rails? it says connection refused if i use anonymous |
From: John A. T. <ja...@ja...> - 2008-11-07 15:55:57
|
Erik Vos wrote: > I consider a class "getInstance()" method to be a perfectly acceptable way > to get access to the instance of a Singleton. Whether or not singletons are > a good idea is a different discussion. In general I see no problems with it, > except that in Rails we should get rid of most existing singletons if we > want to aim for a multi-game server. > > However, I don't understand what you mean with "global variables" in this > context. And I certainly don't see any connection between variables being > global (or whatever) and the use of class getInstance methods. > > Puzzled, > The argument against singletons is that it makes testing hard, as you can't easily replace the underlying object with a mocked instance. The alternative is using dependency injection, such as Guice. Also see http://code.google.com/p/google-singleton-detector/wiki/WhySingletonsAreControversial (which is a Google project to help detect various kinds of global state). -- John A. Tamplin ja...@ja... 770/436-5387 HOME 4116 Manson Ave Smyrna, GA 30082-3723 |
From: Erik V. <eri...@hc...> - 2008-11-07 10:20:00
|
I consider a class "getInstance()" method to be a perfectly acceptable way to get access to the instance of a Singleton. Whether or not singletons are a good idea is a different discussion. In general I see no problems with it, except that in Rails we should get rid of most existing singletons if we want to aim for a multi-game server. However, I don't understand what you mean with "global variables" in this context. And I certainly don't see any connection between variables being global (or whatever) and the use of class getInstance methods. Puzzled, Erik. P.S. Thanks for finding and fixing the 1856 map display bug. Works fine for me. > -----Original Message----- > From: Mark Smith [mailto:mar...@gm...] > Sent: Friday 07 November 2008 01:04 > To: Development list for Rails: an 18xx game > Subject: Re: [Rails-devel] Starting on a client/server > > I can then agree with this change. > > What I feel would be beneficial is to find cases where you are running > 'getInstance' and determine if there is a better way to do this. I > feel the 'getInstance' routine is a bad idea in general, because it > allows for the effective globalization of variables. > > -------------------------------------------------------------- > ----------- > 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 > |
From: Mark S. <mar...@gm...> - 2008-11-07 00:03:36
|
I can then agree with this change. What I feel would be beneficial is to find cases where you are running 'getInstance' and determine if there is a better way to do this. I feel the 'getInstance' routine is a bad idea in general, because it allows for the effective globalization of variables. |
From: Erik V. <eri...@hc...> - 2008-11-06 19:48:06
|
This is almost exactly the solution I have proposed in my discussion earlier this week with Brett. The difference is, that currentPhase is already available, so gameManager does not need to be prepended. > -----Original Message----- > From: Mark Smith [mailto:mar...@gm...] > Sent: Thursday 06 November 2008 02:16 > To: Development list for Rails: an 18xx game > Subject: Re: [Rails-devel] Starting on a client/server > > If this makes sense... then OperatingRound.java class, layTile routine > could be changed from: > > 323 if (!tile.isLayableNow()) { > 324 errMsg = > 325 LocalText.getText("TileNotYetAvailable", > 326 tile.getExternalId()); > 327 break; > 328 } > > to > > 323 if > (!gameManager.getCurrentPhase().isTileColourAllowed > (tile.getColourName())) { > 324 errMsg = > 325 LocalText.getText("TileNotYetAvailable", > 326 tile.getExternalId()); > 327 break; > 328 } > > This would allow the isLayableNow routine to be tossed... and have the > Operating Round which knows about the gameManager to perform the > check. > > I have applied this change to my copy of the code, it compiles without > error. And I then tossed the isLayableNow routine out, and the > abstract reference in Tile as well. > > Mark > > On Wed, Nov 5, 2008 at 7:10 PM, Mark Smith > <mar...@gm...> wrote: > > Hmm... I believe I understand now why my "code-reduction" would not > > work. I have seen cases where you store the instance of an object > > within the object as a static variable, and have a static method to > > return the instance. I generally avoid writing code that depends on > > global variables, and this is one example. If I need a variable down > > in a routine, I attempt to pass it in so there is no ambiguity. > > > > For this example I would have the routine that calls > 'isLayableNow' to > > instead get the tile colour from the Tile Class, then have the Phase > > Class be called asking 'isTileColorAllowed' instead. > > > > You might still have a similar problem of finding the > current phase by > > whatever routine is currently calling 'isLayableNow' but it > would need > > to be examined. Searching for the use of this routine I find one use > > in 'OperatingRound' class, LayTile routine. And it seems to > be just a > > double-check that it did not get selected by mistake, only an error > > message is produced if it is true. > > > > 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 > |
From: Mark S. <mar...@gm...> - 2008-11-06 01:15:49
|
If this makes sense... then OperatingRound.java class, layTile routine could be changed from: 323 if (!tile.isLayableNow()) { 324 errMsg = 325 LocalText.getText("TileNotYetAvailable", 326 tile.getExternalId()); 327 break; 328 } to 323 if (!gameManager.getCurrentPhase().isTileColourAllowed (tile.getColourName())) { 324 errMsg = 325 LocalText.getText("TileNotYetAvailable", 326 tile.getExternalId()); 327 break; 328 } This would allow the isLayableNow routine to be tossed... and have the Operating Round which knows about the gameManager to perform the check. I have applied this change to my copy of the code, it compiles without error. And I then tossed the isLayableNow routine out, and the abstract reference in Tile as well. Mark On Wed, Nov 5, 2008 at 7:10 PM, Mark Smith <mar...@gm...> wrote: > Hmm... I believe I understand now why my "code-reduction" would not > work. I have seen cases where you store the instance of an object > within the object as a static variable, and have a static method to > return the instance. I generally avoid writing code that depends on > global variables, and this is one example. If I need a variable down > in a routine, I attempt to pass it in so there is no ambiguity. > > For this example I would have the routine that calls 'isLayableNow' to > instead get the tile colour from the Tile Class, then have the Phase > Class be called asking 'isTileColorAllowed' instead. > > You might still have a similar problem of finding the current phase by > whatever routine is currently calling 'isLayableNow' but it would need > to be examined. Searching for the use of this routine I find one use > in 'OperatingRound' class, LayTile routine. And it seems to be just a > double-check that it did not get selected by mistake, only an error > message is produced if it is true. > > Mark > |
From: Mark S. <mar...@gm...> - 2008-11-06 00:10:48
|
Hmm... I believe I understand now why my "code-reduction" would not work. I have seen cases where you store the instance of an object within the object as a static variable, and have a static method to return the instance. I generally avoid writing code that depends on global variables, and this is one example. If I need a variable down in a routine, I attempt to pass it in so there is no ambiguity. For this example I would have the routine that calls 'isLayableNow' to instead get the tile colour from the Tile Class, then have the Phase Class be called asking 'isTileColorAllowed' instead. You might still have a similar problem of finding the current phase by whatever routine is currently calling 'isLayableNow' but it would need to be examined. Searching for the use of this routine I find one use in 'OperatingRound' class, LayTile routine. And it seems to be just a double-check that it did not get selected by mistake, only an error message is produced if it is true. Mark On Wed, Nov 5, 2008 at 3:59 PM, Erik Vos <eri...@hc...> wrote: > Mark, > > I'm not sure if I understand your point. > In GameManager, getInstance() is a static method, but getCurrentPhase() is > not. > Your shortened call wouldn't compile. > > Generally spoken, there might indeed be a lot of unwieldy code around. > The code base has grown in ways that may have caused inconsistencies and > redundant code (we have just seen an example - I'm going to fix it soon), > unused or almost duplicate methods etc. When I find such a case, I often try > to fix it, but not always is the solution immediately clear and other > priorities may cause it being forgotten. So it goes. Over time all will be > done (I hope). > > Erik. > > >> -----Original Message----- >> From: Mark Smith [mailto:mar...@gm...] >> Sent: Wednesday 05 November 2008 01:43 >> To: Development list for Rails: an 18xx game >> Subject: Re: [Rails-devel] Starting on a client/server >> >> I would like to pose a question using your example routine in >> the Tile Class: >> >> 325 /** >> 326 * Is the tile layable now (in the current phase)? >> 327 * >> 328 * @return >> 329 */ >> 330 public boolean isLayableNow() { >> 331 return >> GameManager.getInstance().getCurrentPhase().isTileColourAllowe >> d(colourName); >> 332 } >> >> This calls in the Game Manager the 'getInstance ()' routine: >> >> 336 /** >> 337 * @return instance of GameManager >> 338 */ >> 339 public static GameManager getInstance() { >> 340 return instance; >> 341 } >> >> What I am very puzzled by is why bother to call to get the >> instance at all? >> If you have the GameManager, you already have a copy of the instance. >> You can reduce the original call to: >> >> 325 /** >> 326 * Is the tile layable now (in the current phase)? >> 327 * >> 328 * @return >> 329 */ >> 330 public boolean isLayableNow() { >> 331 return >> GameManager.getCurrentPhase().isTileColourAllowed(colourName); >> 332 } >> >> And even saving the a pointer to the object within the object is a >> circular reference that accomplishes nothing useful that I can see. >> >> Maybe I am failing to realize why you bother with this >> self-referencing object. >> >> 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 > |
From: Erik V. <eri...@hc...> - 2008-11-05 20:59:24
|
Mark, I'm not sure if I understand your point. In GameManager, getInstance() is a static method, but getCurrentPhase() is not. Your shortened call wouldn't compile. Generally spoken, there might indeed be a lot of unwieldy code around. The code base has grown in ways that may have caused inconsistencies and redundant code (we have just seen an example - I'm going to fix it soon), unused or almost duplicate methods etc. When I find such a case, I often try to fix it, but not always is the solution immediately clear and other priorities may cause it being forgotten. So it goes. Over time all will be done (I hope). Erik. > -----Original Message----- > From: Mark Smith [mailto:mar...@gm...] > Sent: Wednesday 05 November 2008 01:43 > To: Development list for Rails: an 18xx game > Subject: Re: [Rails-devel] Starting on a client/server > > I would like to pose a question using your example routine in > the Tile Class: > > 325 /** > 326 * Is the tile layable now (in the current phase)? > 327 * > 328 * @return > 329 */ > 330 public boolean isLayableNow() { > 331 return > GameManager.getInstance().getCurrentPhase().isTileColourAllowe > d(colourName); > 332 } > > This calls in the Game Manager the 'getInstance ()' routine: > > 336 /** > 337 * @return instance of GameManager > 338 */ > 339 public static GameManager getInstance() { > 340 return instance; > 341 } > > What I am very puzzled by is why bother to call to get the > instance at all? > If you have the GameManager, you already have a copy of the instance. > You can reduce the original call to: > > 325 /** > 326 * Is the tile layable now (in the current phase)? > 327 * > 328 * @return > 329 */ > 330 public boolean isLayableNow() { > 331 return > GameManager.getCurrentPhase().isTileColourAllowed(colourName); > 332 } > > And even saving the a pointer to the object within the object is a > circular reference that accomplishes nothing useful that I can see. > > Maybe I am failing to realize why you bother with this > self-referencing object. > > 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 > |
From: Mark S. <mar...@gm...> - 2008-11-05 00:42:55
|
I would like to pose a question using your example routine in the Tile Class: 325 /** 326 * Is the tile layable now (in the current phase)? 327 * 328 * @return 329 */ 330 public boolean isLayableNow() { 331 return GameManager.getInstance().getCurrentPhase().isTileColourAllowed(colourName); 332 } This calls in the Game Manager the 'getInstance ()' routine: 336 /** 337 * @return instance of GameManager 338 */ 339 public static GameManager getInstance() { 340 return instance; 341 } What I am very puzzled by is why bother to call to get the instance at all? If you have the GameManager, you already have a copy of the instance. You can reduce the original call to: 325 /** 326 * Is the tile layable now (in the current phase)? 327 * 328 * @return 329 */ 330 public boolean isLayableNow() { 331 return GameManager.getCurrentPhase().isTileColourAllowed(colourName); 332 } And even saving the a pointer to the object within the object is a circular reference that accomplishes nothing useful that I can see. Maybe I am failing to realize why you bother with this self-referencing object. Mark |
From: Brett L. <wak...@gm...> - 2008-11-04 21:48:04
|
On Tue, 2008-11-04 at 21:46 +0100, Erik Vos wrote: > > It sounds like you feel strongly that I should bring in my changes now > > rather than wait until they are further along. Is that about > > the size of > > it? > > No, that is not what I meant to say. My intention was to emphasize that, > once you are going to check it in, that during the integration period it > could better be kept separate in some way or other from the existing code, > until we agree that the integration is going to be successful. But I don't > know what your plan is - first doing an (almost) full integration > separately? > The point is, that I suspect that not that many classes will escape from > being affected by your new approach. > Agreed. I had assumed that I'd just create a new CVS module, or check it into sourceforge's SVN service if we wanted to change over to subversion (not trying to start that discussion now, just mentioning it because it's an available option). > (snipped a lot) > > > In general, I'd like to improve the accessor methods so that we don't > > require GameManager to know or do as much. > > > > For example, in Tile there's the isLayableNow() method: > > > > public boolean isLayableNow() { > > return > > GameManager.getInstance().getCurrentPhase().isTileColourAllowe > > d(colourName); > > } > > Good example. > > > This method is currently used exactly once in our entire > > codebase. This > > method is used in OperatingRound. > > > > In my mind, there are two problems with this. > > > > 1. Why do we need a whole new method in Tile for information that Tile > > doesn't even have? > > Fully agree. This logic should be moved to OperatingRound (which BTW already > has a GameManager reference). > > > 2. I think that this is information that Tile *should* have. Tile > > shouldn't need to call all the way up to the GameManager to > > figure this > > out. > > Fully disagree. Tiles should mind their own business, which is how they look > like. > Even the fact that they know where they are laid is somewhat suspicious; in > fact this knowledge is only used to calculate the number of available tiles; > so that ArrayList<MapHex> could as well be replaced by a number. > Fair enough. I think we agree on the important point, which is that we need to have a clear purpose for each class, and refactor anything that has been added that doesn't line up with that purpose. > > One likely answer is to change isLayableNow()'s signature to be > > 'isLayableNow(phaseNumber)' or something similar. That way > > Tile has the > > information it needs to be authoritative for this information, rather > > than relying on GameManager to know this. > > As will be clear now, my solution is to replace tile.isLayableNow() (in > OperatingRound) by currentPhase.isTileColourAllowed(tile.getColourName()). > Then we can remove this whole silly and redundant method > (of my own making, I'm afraid). > > > My view is that Tile should be constructed with enough information to > > know these sorts of things on its own. If it needs GameManager, it's > > because we aren't passing in enough information to the Tile objects at > > construction time. > > > > To fix our overuse of static methods, I think we need to improve the > > accessor methods and how we're constructing our objects. > > > > When we no longer require instances of GameManager everywhere, then we > > no longer require GameManager to have the static > > getInstance() method. > > > > I believe the same logic applies to most of the other static > > methods we > > have. > > > > I hope that makes sense. > > It sure makes, but I would phrase the solution as making a better > distinction between game logic (I had almost written: business logic) and > static objects. Tiles, companies, shares, trains are mainly static objects > (although most of these must know their owners). The game logic should be in > (or moved to) the Round instances and some related classes. That is why I > find your example so instructive. > > But not all cases will not be so easy to fix, I'm afraid. > Of course, not everything is a one-line method. I picked an obvious example to help illustrate my idea. ;-) I think we agree on the basic concept. We need a series of objects that hold the game state, and a series of objects that operate upon that state, and we need to clearly define which is which. > > > I think what's important is that perhaps I'm wrong about > > wanting to wait > > to commit this. Perhaps what I've got so far *is* ready for a wider > > audience and really should be committed into CVS. I was beginning to > > second-guess myself about wanting to wait longer before I committed it > > to the project. So, this thread was intended to get your > > opinions about > > it. I figure, if I'm not sure I'm doing it right, I should run it by > > someone else. :-) > > Committing is OK with me, but please do it in a way that all the old code > keeps running until your new code is sufficiently well-integrated to show > its superiority.... > > Erik. Alright. I think, for now, I'll just keep it in my git tree. I want to integrate the client/server bits a little more so that when it's committed, it'll be a stable base for integrating the rest of the existing code. ---Brett. Experience, n.: Something you don't get until just after you need it. -- Olivier |
From: Erik V. <eri...@hc...> - 2008-11-04 20:46:37
|
> It sounds like you feel strongly that I should bring in my changes now > rather than wait until they are further along. Is that about > the size of > it? No, that is not what I meant to say. My intention was to emphasize that, once you are going to check it in, that during the integration period it could better be kept separate in some way or other from the existing code, until we agree that the integration is going to be successful. But I don't know what your plan is - first doing an (almost) full integration separately? The point is, that I suspect that not that many classes will escape from being affected by your new approach. (snipped a lot) > In general, I'd like to improve the accessor methods so that we don't > require GameManager to know or do as much. > > For example, in Tile there's the isLayableNow() method: > > public boolean isLayableNow() { > return > GameManager.getInstance().getCurrentPhase().isTileColourAllowe > d(colourName); > } Good example. > This method is currently used exactly once in our entire > codebase. This > method is used in OperatingRound. > > In my mind, there are two problems with this. > > 1. Why do we need a whole new method in Tile for information that Tile > doesn't even have? Fully agree. This logic should be moved to OperatingRound (which BTW already has a GameManager reference). > 2. I think that this is information that Tile *should* have. Tile > shouldn't need to call all the way up to the GameManager to > figure this > out. Fully disagree. Tiles should mind their own business, which is how they look like. Even the fact that they know where they are laid is somewhat suspicious; in fact this knowledge is only used to calculate the number of available tiles; so that ArrayList<MapHex> could as well be replaced by a number. > One likely answer is to change isLayableNow()'s signature to be > 'isLayableNow(phaseNumber)' or something similar. That way > Tile has the > information it needs to be authoritative for this information, rather > than relying on GameManager to know this. As will be clear now, my solution is to replace tile.isLayableNow() (in OperatingRound) by currentPhase.isTileColourAllowed(tile.getColourName()). Then we can remove this whole silly and redundant method (of my own making, I'm afraid). > My view is that Tile should be constructed with enough information to > know these sorts of things on its own. If it needs GameManager, it's > because we aren't passing in enough information to the Tile objects at > construction time. > > To fix our overuse of static methods, I think we need to improve the > accessor methods and how we're constructing our objects. > > When we no longer require instances of GameManager everywhere, then we > no longer require GameManager to have the static > getInstance() method. > > I believe the same logic applies to most of the other static > methods we > have. > > I hope that makes sense. It sure makes, but I would phrase the solution as making a better distinction between game logic (I had almost written: business logic) and static objects. Tiles, companies, shares, trains are mainly static objects (although most of these must know their owners). The game logic should be in (or moved to) the Round instances and some related classes. That is why I find your example so instructive. But not all cases will not be so easy to fix, I'm afraid. > I think what's important is that perhaps I'm wrong about > wanting to wait > to commit this. Perhaps what I've got so far *is* ready for a wider > audience and really should be committed into CVS. I was beginning to > second-guess myself about wanting to wait longer before I committed it > to the project. So, this thread was intended to get your > opinions about > it. I figure, if I'm not sure I'm doing it right, I should run it by > someone else. :-) Committing is OK with me, but please do it in a way that all the old code keeps running until your new code is sufficiently well-integrated to show its superiority.... Erik. |
From: Mark S. <mar...@gm...> - 2008-11-04 11:49:06
|
Yep, those look better. When I first noticed it as I was creating my TileSet for my Game_18xx Engine I thought at first it was my mistake, and pulled out my copy of 1853 and double-checked. But all good now. Mark On Mon, Nov 3, 2008 at 10:59 PM, John David Galt < jd...@di...> wrote: > Mark Smith wrote: > > No toes were hurt by the message. I was just confirming the validity of > > your statement about not trusting an actual printed copy of the game. I > > have seen some site, even www.18xx.net <http://www.18xx.net> have some > > errors in it (like the Tile Set for 1853). If you Look at: > > > > http://18xx.net/tiles/1853.htm > > > > And See Tile # 94 and # 95, as shown are the same tile. However, if you > > look at the actual copy of the game, each of these tiles should have > > only 4 track segments (2 Normal, 2 Metre) in a K formation, like Tile 96 > > and 97. > > Thank you, I didn't notice that. I've just fixed it. > > > ------------------------------------------------------------------------- > 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 > |