It is currently 26 Apr 2024, 21:19
   
Text Size

Iterable CardList

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, 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: No registered users and 93 guests


Who is online

In total there are 93 users online :: 0 registered, 0 hidden and 93 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 93 guests

Login Form