public VehicleMod this[VehicleModType modType] { get { if (!_vehicleMods.TryGetValue(modType, out VehicleMod vehicleMod)) { vehicleMod = new VehicleMod(_owner, modType); _vehicleMods.Add(modType, vehicleMod); } return(vehicleMod); } }
public VehicleMod this[VehicleModType modType] { get { VehicleMod mod = null; if (!this._vehicleMods.TryGetValue(modType, out mod)) { mod = new VehicleMod(this._owner, modType); this._vehicleMods.Add(modType, mod); } return(mod); } }