By some reason the current approach is to recreate whole list of sc2::Unit objects and fill it from scratch using info from the game. As a result, we have to recheck unit's type to set the is_building flag, which triggers lots of 'ifs' in switch block.
Lets try to do a kind of caching or at least create a hash map to speed up the things.