def get_unit(key)
    @assigned_factories[key] ||= source_factories[rand(source_factories.length)]
    @assigned_factories[key].get_unit(key)
  end
def get_unit(key)
    @assigned_factories[key] ||= source_factories[rand(source_factories.length)]
    @assigned_factories[key].get_unit(key)
  end
Returns the value of get_unit from the Factory assigned to the given key.
When a key is needed that a Factory is not already assigned to, one will be assigned at random from the pool of source factories.