Re: please let me refactor references to static fields, etc.

Posted:
27 Jun 2011, 15:15
by Hellfish
No no, the card is played properly, but is nowhere to be seen afterwards.If I change the ID of the ManaPool to, say0 , there is no problem.
Re: please let me refactor references to static fields, etc.

Posted:
27 Jun 2011, 15:22
by Braids
Sloth wrote:Maybe this is the dreaded unplayable card in your hand bug?
You mean the one that is marked as summoning sick even though it is in my hand?
Re: please let me refactor references to static fields, etc.

Posted:
27 Jun 2011, 15:31
by Hellfish
heh,sorry, mistyped.

If I set the CardID to 0 or something over the number of cards in my deck, it's fine.
ManaPool bug

Posted:
27 Jun 2011, 15:53
by Braids
I'm, I'm... going to need some help.
Can someone point me to where this bug might be?
Re: please let me refactor references to static fields, etc.

Posted:
27 Jun 2011, 16:01
by Hellfish
I don't know why the ManaPool overwrites cards just because it shares a card ID with them, but I committed a hack that sets the ManaPools ID to 0, forge.card.mana.ManaPool.java:41.
Re: please let me refactor references to static fields, etc.

Posted:
27 Jun 2011, 16:55
by Braids
Hellfish wrote:I committed a hack that sets the ManaPools ID to 0, forge.card.mana.ManaPool.java:41.
Thank you. What about the AI's ManaPool? Or does it not yet have one?
Re: please let me refactor references to static fields, etc.

Posted:
27 Jun 2011, 17:31
by Hellfish
I believe it recently got one, but it doesn't have a card representation of it that can overwrite anything.
Re: please let me refactor references to static fields, etc.

Posted:
27 Jun 2011, 17:34
by Chris H.
Hellfish wrote:I believe it recently got one, but it doesn't have a card representation of it that can overwrite anything.
`
Choppic had some wonderful ideas in reference to how we could do a graphical update to the player panels in the battlefield display. Something else for all of us to look forward to one day.

Re: please let me refactor references to static fields, etc.

Posted:
27 Jun 2011, 19:23
by Sloth
Braids wrote:Hellfish wrote:I committed a hack that sets the ManaPools ID to 0, forge.card.mana.ManaPool.java:41.
Thank you. What about the AI's ManaPool? Or does it not yet have one?
The AI mana pool is created just like the human mana pool which would mean they have both the ID 0 now. I will test if this will create any problems.
UPDATE: There is some weird stuff going on now (at least the displaying of AI mana is wrong), we should better find another solution.
Re: please let me refactor references to static fields, etc.

Posted:
27 Jun 2011, 20:53
by Hellfish
Ah, my mistake, there *is* a card representation of the AI's mana pool, it just isn't shown on the battlefield, like the human player's is. FAKE EDIT: I think I see the problem, there are two different places in the code that each does it's own thing with UniqueNumber. A static field in Card and a block in GameAction.newGame. The static field starts at 0 at program initialization, shortly before a null card and the two ManaPools are created, numbered 1 and 2. Then, at each newgame, the other code loops through the cards in each deck and renumbers them 1-60 again.Ay', there's the rub, as some british bloke wrote somewhere.
Re: please let me refactor references to static fields, etc.

Posted:
28 Jun 2011, 00:46
by Braids
Hellfish wrote:I think I see the problem . . . Ay', there's the rub, as some british bloke wrote somewhere.
thank you!
edit 1: because the static field changes and removals seem to be stable, i started a new topic to focus on the lazy CardFactory changes at
http://www.slightlymagic.net/forum/viewtopic.php?f=52&t=4904edit 2: also because the java 5/6 changes seem to be ok.