tag:blogger.com,1999:blog-7523569453469773247.post3151600407819277183..comments2015-02-11T12:13:10.578+01:00Comments on Laterna Magica: MtG programming: Last Known Information with UndoUnknownnoreply@blogger.comBlogger6125tag:blogger.com,1999:blog-7523569453469773247.post-85509080299781841652010-08-22T16:11:46.961+02:002010-08-22T16:11:46.961+02:00This is a great idea! I hope that undo works as go...This is a great idea! I hope that undo works as good as I hope/expect, but it's good to have a fallback plan<br /><br />in one way or another, my program will have such thing for targets: when a targeted card changes zones, it is an illegal. I'll need to handle that in a similar way, when the reference is "lost" when the card changes zonesSilly Freakhttps://www.blogger.com/profile/09963238585847993157noreply@blogger.comtag:blogger.com,1999:blog-7523569453469773247.post-51762171574285659152010-08-22T15:01:56.586+02:002010-08-22T15:01:56.586+02:00Hey Silly Freak,
I had the same problem. I don'...Hey Silly Freak,<br />I had the same problem. I don't have an undo architecture, so I couldn't use that approach, but the idea I came up with is that each card has a set of roles that exist in each zone. I separate the meta-identity of the card from the roles it takes, and those roles (such as OutOfPlayRole, StackRole, PermanentRole, etc) are what the game actually references for characteristics, damage, etc. So when a card changes zones, it instantiates the role that it will become and returns that to the game engine. The great thing about this approach is that when the card leaves that zone, that 'role' object is a frozen snapshot of the way the card looked right before it left. Also, any effect that referenced that card would have a reference to that role object, and when nothing else needed to access it the role would be garbage collected (although I have been considering the possibility of storing the chain of previous roles with the card, but I haven't seen a need for it yet).Incantusnoreply@blogger.comtag:blogger.com,1999:blog-7523569453469773247.post-67069365965013171522010-08-13T19:20:22.408+02:002010-08-13T19:20:22.408+02:00Warp World is insane and hats off to you for even ...Warp World is insane and hats off to you for even trying it. Personally I don't understand last known information at all.<br /><br />I presume you are using the <a href="http://wizards.com/Magic/TCG/Article.aspx?x=magic/rules" rel="nofollow">Comprehensive Rules</a> as your guide. The Magic Set Faqs are also good. Checkout the <a href="http://wizards.com/dci/downloads/MTGM10FAQ20090702.rtf" rel="nofollow">Magic 2010 faq</a> for a detailed explanation of Warp World.<br /><br />I can't wait until you get something working :)Forgehttps://www.blogger.com/profile/15838286606081721333noreply@blogger.comtag:blogger.com,1999:blog-7523569453469773247.post-23512219355712443612010-08-13T11:02:18.931+02:002010-08-13T11:02:18.931+02:00"your ActiveChangedListener.Internal extends ..."your ActiveChangedListener.Internal extends DrawListener. I believe it should have extend itself, right?"<br /><br />right, must have slipped through somehow...<br /><br />"I like Alternate Universes as well as the fact that your project now uses maven :)"<br /><br />yeah, maven is cool. I wanted to write about it by now, but I'm still experiencing problems with the new TreeProperties and Utils project. I'll come back to it once that's sorted out.Silly Freakhttps://www.blogger.com/profile/09963238585847993157noreply@blogger.comtag:blogger.com,1999:blog-7523569453469773247.post-80340419069127725962010-08-12T21:56:35.618+02:002010-08-12T21:56:35.618+02:00your ActiveChangedListener.Internal extends DrawLi...your ActiveChangedListener.Internal extends DrawListener. I believe it should have extend itself, right?nantuko84https://www.blogger.com/profile/15891352523600843744noreply@blogger.comtag:blogger.com,1999:blog-7523569453469773247.post-47648410383015544082010-08-12T20:22:23.466+02:002010-08-12T20:22:23.466+02:00I like Alternate Universes as well as the fact tha...I like Alternate Universes as well as the fact that your project now uses maven :)nantuko84https://www.blogger.com/profile/15891352523600843744noreply@blogger.com