ruff_hi
Live 4ever! Or die trying
like the code - thx EF. I'm just going to run thru my logic so that you can get a laugh and correct me. BTW - set() sounds great!
pseudo code...
- I have a unit that player A can build ... UnitA (think horse archer).
- I also have set of units that player B can build.
- Now, I want to display UnitA if that unit (or any of the units that UnitA upgrades to) is not in the set that B can build.
- So if the set of units that B can build contains a chopper, then no horse archer.
pseudo code...
Code:
AllPlayerAs_Units = getCanTrain(PlayerA)
AllPlayerBs_Units = getCanTrain(PlayerB)
for UnitA in AllPlayerAs_Units
UpgradeSet_UnitA = get_set_of_units_to_check(UnitA)
if len(UpgradeSet_UnitA & AllPlayerBs_Units) > 0:
add UnitA button
def getCanTrain(PlayerA)
I already have this
def get_set_of_units_to_check(UnitA)
I will be looking at your code to build this