Iterable SFSArray

Post here your suggestions for new possible features in SmartFoxServer 2X.

Moderators: Lapo, Bax

brunoma
Posts: 20
Joined: 11 Jan 2012, 16:36
Location: London, Ontario, Canada

Iterable SFSArray

Postby brunoma » 23 Oct 2013, 13:58

Suggest making SFSArray's use java.lang.Iterable<T> interface so we can use foreach syntax on them.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Iterable SFSArray

Postby Lapo » 06 Nov 2013, 08:54

The problem I see with this is that the SFSArray, by definition, doesn't support a fixed T type. It can contain all sorts of typed data (19 different types actually)
An iterator would help but you would get a fixed wrapper type that handles bot the type and value of each element. This in turn means that inside your for...each loop you would still need quite a bit of conditional code to work with different types.
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “2X Features Wish List”

Who is online

Users browsing this forum: No registered users and 15 guests