Mercurial > wow > breuesk
comparison Lists.lua @ 3:431ddc8bdb4a
Beginnings of a random populate command
author | John@Yosemite-PC |
---|---|
date | Fri, 02 Mar 2012 23:09:14 -0500 |
parents | 00286ba3b9c4 |
children | 6c8f9473b22e |
comparison
equal
deleted
inserted
replaced
2:00286ba3b9c4 | 3:431ddc8bdb4a |
---|---|
322 bsk:AddPlayer(i) | 322 bsk:AddPlayer(i) |
323 end | 323 end |
324 end | 324 end |
325 -- TODO: batch into a single op - no need to spam 25 messages in a row | 325 -- TODO: batch into a single op - no need to spam 25 messages in a row |
326 end | 326 end |
327 function bsk:PopulateListRandom(index) | |
328 -- difference (raid+reserve)^list, then random shuffle that, then add | |
329 bsk:PopulateRaidList() | |
330 local list = bsk.lists[index] | |
331 | |
332 local t = {} | |
333 --for i = 1,#list do | |
334 -- if not (RaidList(list[i]) or ReserveList(list[i])) then | |
335 -- tinsert(t,) | |
336 -- end | |
337 --end | |
338 end | |
327 --}}} | 339 --}}} |
328 | 340 |
329 -- "Soft" actions- ie things that cause nonpermanent state {{{ | 341 -- "Soft" actions- ie things that cause nonpermanent state {{{ |
330 | 342 |
331 -- reserves | 343 -- reserves |
414 end | 426 end |
415 end | 427 end |
416 assert(false) | 428 assert(false) |
417 end | 429 end |
418 | 430 |
431 local shuffleArray = function(array) | |
432 local arrayCount = #array | |
433 for i = arrayCount, 2, -1 do | |
434 local j = math.random(1, i) | |
435 array[i], array[j] = array[j], array[i] | |
436 end | |
437 return array | |
438 end | |
439 |