Closed GoogleCodeExporter closed 9 years ago
Yes, thanks for spotting this question up -- it also requires some
clarification. In the beginning it was only the sequential approach elaborated,
i.e. it is obvious here what's happening:
CmdLineOptions c = new CmdLineOptions(); //all documented defatuls
c.setEnemies("g:10"); // 10 goombas
c.setInvulnerable(true); // defaults, but 10 goombas and Mario is invulnerable
to creatures.
WOuld you say that c.setArgs("...") should be invariant w.r.t. place it appears
and c.setEnemies("g:10") should drop
In this case the cumulative changes are a bit harder to "collect". Now, the
class does it for you, and by keeping track what's there, one can tweak the
levels in a desired way. Otherwise in GamePlay it will be necessary to spot
each additional parameter explicitly as CmdLineOptions class will not store all
the changes step-by-step. Yet the initial idea of using hash map was also this
one: to keep track of previous changes.
I came up with this idea: CmdLineOptions.reset() method, that drops all options
to defaults and is called whenever required. This will keep current behaviour
and would allow to have invariants of set of options that uniquely define the
level.
Original comment by Sergey.K...@gmail.com
on 29 Oct 2010 at 9:45
[deleted comment]
[deleted comment]
I can definitely see the convenience of being able to build up options, and
like your solution of adding a reset(). This way if someone was worried about
it and wanted to set everything explicitly they could call reset() and not have
to worry.
Thanks.
Original comment by melin...@gmail.com
on 29 Oct 2010 at 9:56
This issue was closed by revision r642.
Original comment by Nikolay....@gmail.com
on 10 Nov 2010 at 7:20
Original issue reported on code.google.com by
melin...@gmail.com
on 28 Oct 2010 at 10:22