OrionVeteran
Deity
Why exactly are you iterating dPromotionsList? I would assume that you would want the dictionary:
...to return the index values of PromotionTypes.PROMOTION_COMBAT7 and PromotionTypes.PROMOTION_GUERILLA3. Because you wanna do something with these enums, right?Code:{ "COMBAT1" : (1, "COMBAT"), "COMBAT2 : (2, "COMBAT"), "COMBAT3 : (3, "COMBAT"), "COMBAT4 : (4, "COMBAT"), "COMBAT5 : (5, "COMBAT"), "COMBAT6 : (6, "COMBAT"), "COMBAT7 : (7, "COMBAT"), "GUERILLA1 : (1, "GUERILLA"), "GUERILLA2 : (2, "GUERILLA"), "GUERILLA3 : (3, "GUERILLA"), }
This:
Code:
dPromotionList = {
"PROMOTION_COMBAT1": (1, "COMBAT"),
"PROMOTION_COMBAT2": (2, "COMBAT"),
"PROMOTION_COMBAT3": (3, "COMBAT"),
"PROMOTION_COMBAT4": (4, "COMBAT"),
"PROMOTION_COMBAT5": (5, "COMBAT"),
"PROMOTION_COMBAT6": (6, "COMBAT"),
"PROMOTION_GUERILLA1": (1, "GUERILLA"),
"PROMOTION_GUERILLA2": (2, "GUERILLA"),
"PROMOTION_GUERILLA3": (3, "GUERILLA")
}
I shortened the list for the sake of brevity. I want to group the strGroup, which will summarize the promotion group to use elsewhere. I will also use the entire list in multiple functions. The group is key to my logic, as it allows me to determie if a promotion belongs to a group. Randum checks for group promotions are handled differently from promotions that do not belong to a group. Single promotions are identified in strGroup as "NONE".