the prototype pattern def build_unit(selfunit_typelevel)return self units[unit_type][levelclone(if __name__ ="__main__"barracks baracks(knight barracks build_unit("knight" archer barracks build_unit("archer" print("[knight {}format(knight )print("[archer {}format(archer )when we extended the abstract base class in the unit classesthat forced us to implement the clone methodwhich we used when we had the barracks generate new units the other thing we did was generate all the options that barracks instance can generate and keep it in unit' array nowwe can simply clone the unit with the right level without opening file or loading any data from an external source [knight typeknight life speed attack power attack range weaponshort sword [archer typearcher life speed attack power attack range weaponlong bow well doneyou have not only taken your first steps to creating your very own rtsbut you have also dug deeply into very useful design pattern exercises take the prototype example code and extend the archer class to handle its upgrades experiment with adding more units to the barracks building