if squad_name == "ork_squad_stormboy" then tactic = StormBoyzTactic( squad_ai ) elseif squad_name == "chaos_squad_cultist" then tactic = CultistTactic( squad_ai ) elseif squad_name == "ork_squad_bad_dok" then tactic = BadDokTactic( squad_ai ) else tactic = InfantryTactic( squad_ai ) end
Class InfantryTactic( ) is detailed with UpgradeAndReinforce() and lots of other functions whereas StormBoyzTactic() is as empty as this
class 'StormBoyzTactic' (InfantryTactic) function StormBoyzTactic:__init( squad_ai ) super( squad_ai ) end function StormBoyzTactic:GetName() return "StormBoyz Tactic" end
So what do StormBoyz with UpgradeAndReinforce() ? I guess its some OO stuff but my skillz are low in this department.
Same goes for CultistTactic(). I don't understand the changes of Thudo which look like this
function CultistTactic:UpgradeAndReinforce() --Upgrade/reinforce cultists -- they're useful meatshields! return true end
According to my understanding return true (which was only 'return' in the original) will do nothing as the real upgrade/reinforce stuff in InfantryTactic:UpgradeAndReinforce() is never used.
So how is it working. Is it
A) All functions of InfantryTactic() are used for every squad but are replaced by special functions of the same name like UpgradeAndReinforce() if there is a special file for a certain squad type (cultists) including them.
B) Either ALL the functions of InfantryTactic() OR ONLY those in special files are used.
C) completly different
Edited by LarkinVB, 19 January 2005 - 03:06 PM.