Emulates logic of units in sc2 and builds buildtree