- Sep 30, 2018
- 102
- 70
Hi,
have a class of gameEvents with for sample a flag which shows if the event already played today
In game, when the event is played we update it for sample $myEvent01.flag=1
Each end of day we control all the events and reset the flag to 0
It's why i create a list of for iterate
My questions are :
- is there another way to do like a class iteration...
- if no, is it better to do a dico directly like this for sample
have a class of gameEvents with for sample a flag which shows if the event already played today
Python:
.../...
class gameEvent:
.../...
self.flag = 0
default myEvent01 = gameEvent(...)
default myEvent02 = gameEvent(...)
default myEvent03 = gameEvent(...)
.../...
Each end of day we control all the events and reset the flag to 0
It's why i create a list of for iterate
Python:
default listEvents = [myEvent01, myEvent02, myEvent03...]
.../...
label dailyResetEvents:
For....
- is there another way to do like a class iteration...
- if no, is it better to do a dico directly like this for sample
Python:
default dicoEvents = {
"myEvent01" : gameEvent(),
"myEvent02" : gameEvent(),
"myEvent03" : gameEvent(),
.../...
}
Last edited: