ShuffledEventListclass | eventList.t[400], eventListItem.t[362] |
Superclass Tree | Subclass Tree | Global Objects | Property Summary | Method Summary | Property Details | Method Details |
For the first time through the main list, we normally shuffle the strings immediately at startup, but this is optional. If shuffleFirst is set to nil, we will NOT shuffle the list the first time through - we'll run through it once in the given order, then shuffle for the next time through, then shuffle again for the next, and so on. So, if you want a specific order for the first time through, just define the list in the desired order and set shuffleFirst to nil.
You can optionally specify a separate list of one-time-only sequential strings in the property firstEvents. We'll run through these strings once. When we've exhausted them, we'll switch to the main eventList list, showing it one time through in its given order, then shuffling it and running through it again, and so on. The firstEvents list is never shuffled - it's always shown in exactly the order given.
Modified in eventListItem.t[362]:
Mofiications to ShuffledEventList for EventListItem extension
class
ShuffledEventList : RandomFiringScript EventList
ShuffledEventList
RandomFiringScript
object
EventList
Script
object
firstEvents
shuffledList_
shuffleFirst
suppressRepeats
Inherited from RandomFiringScript
:
eventPercent
eventReduceAfter
eventReduceTo
Inherited from EventList
:
curScriptState
eventList
eventListLen
resetEachCycle
addItem
doScript
getNextRandom
resetList
Inherited from RandomFiringScript
:
checkEventOdds
underusedReadyELIidx
Inherited from EventList
:
advanceState
construct
doScriptEvent
scriptDone
Inherited from Script
:
getScriptState
firstEvents | eventList.t[405] |
shuffledList_ | eventList.t[510] |
shuffleFirst | eventList.t[415] |
suppressRepeats | eventList.t[430] |
You might want to set this to nil for lists of three or four elements, since such short lists can result in fairly un-random-looking sequences when repeats are suppressed, because the available number of permutations drops significantly.
addItem (item, prop) OVERRIDDEN | eventListItem.t[417] |
doScript ( ) OVERRIDDEN | eventList.t[433] |
getNextRandom ( ) | eventList.t[490], eventListItem.t[369] |
Modified in eventListItem.t[369]:
For the EventListItem extenstion we modify this method so that it first chooses any as yet unused EventListItem from our eventList that's now ready to fire. If none is found, we use the inherited behaviour to select the next item indicated by our shuffledList_ .
resetList ( ) OVERRIDDEN | eventListItem.t[401] |
One potentially good place to call this from as at the end of each iteration of a ShuffledEventList, when the items are about to be reshuffled in any case. You can make this happen by setting the resetOnReshuffle property to true,