It is currently 07 Jul 2021, 08:11
   
Text Size

Iterable CardList

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, friarsol, Blacksmith, KrazyTheFox, Agetian, CCGHQ Admins

Iterable CardList

Postby eugenrivniy » 20 Sep 2009, 21:14

Hi. I think that if CardList will be iterable, it be more usefull, because we can use easy-to-use 'foreach' instead of complex'for (...)'.
Patch attached.

Code: Select all
3c3
< public class CardList
---
> public class CardList implements Iterable<Card>
208a209,213
>     
>    @Override
>    public Iterator<Card> iterator() {      
>       return list.iterator();
>    }
eugenrivniy
 
Posts: 6
Joined: 20 Sep 2009, 21:02
Has thanked: 0 time
Been thanked: 1 time

Re: Iterable CardList

Postby DennisBergkamp » 21 Sep 2009, 00:50

Cool, I've changed this for the next version, thanks :)
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Iterable CardList

Postby nantuko84 » 22 Sep 2009, 09:42

really cool!)
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times


Return to Developer's Corner

Who is online

Users browsing this forum: Bing [Bot] and 10 guests


Who is online

In total there are 11 users online :: 1 registered, 0 hidden and 10 guests (based on users active over the past 10 minutes)
Most users ever online was 1922 on 07 Jun 2021, 06:01

Users browsing this forum: Bing [Bot] and 10 guests

Login Form