comparison Lists.lua @ 7:241986f7066c

Comments
author John@Doomsday
date Tue, 06 Mar 2012 09:33:04 -0500
parents 6d460ff2135c
children b05fcb225c4a
comparison
equal deleted inserted replaced
6:6d460ff2135c 7:241986f7066c
9 9
10 -- TODO: rename player 10 -- TODO: rename player
11 -- TODO: list trimming 11 -- TODO: list trimming
12 12
13 -- notes on list storage: 13 -- notes on list storage:
14 -- Storing names as I do now is atrocious. 14 -- Using names as keys as I do now is atrocious.
15 -- It prevents insertions (twss) to the middle of the list because then it acts 15 -- It prevents insertions (twss) to the middle of the list because then it acts
16 -- as a side effect onto all the others. ie ABCD -> AXBCD would be phrased as 16 -- as a side effect onto all the others. ie ABCD -> AXBCD would be phrased as
17 -- "insert X and shift down B,C,D" which sucks. BCD haven't really been affected 17 -- "insert X and shift down B,C,D" which sucks. BCD haven't really been affected
18 -- (yet) because their relative positions to the others are still intact - ie 18 -- (yet) because their relative positions to the others are still intact - ie
19 -- they are still below A right where they belong. But really X hasn't done 19 -- they are still below A right where they belong. But really X hasn't done
213 assert(change) 213 assert(change)
214 assert(change.arg.guid) 214 assert(change.arg.guid)
215 local arg = change.arg 215 local arg = change.arg
216 -- require admin 216 -- require admin
217 local players = bsk.players 217 local players = bsk.players
218 -- TODO: new struct is ordered list {main="breue",alts={},active=boolean}
219 local name = arg.name 218 local name = arg.name
220 local guid = arg.guid 219 local guid = arg.guid
221 assert(players[guid]==nil) 220 assert(players[guid]==nil)
222 players[guid] = name 221 players[guid] = name
223 players.time=change.time 222 players.time=change.time