public static VehicleRecord GetName(JsonString id) { VehicleRecord name; if (VehicleIdToName.TryGetValue(id, out name)) { return(name); } return(VehicleRecord.EmptyFor(id)); }
/// <summary> /// Gets vehicle name from vehicle Id from game database with caching /// </summary> public static VehicleRecord GetVehicleName(JsonString id) { if (id != null && id.InnerString != "0") { VehicleRecord vehicleRecord; if (VehicleCache.TryGetName(id, out vehicleRecord)) { return(vehicleRecord); } return(VehicleRecord.EmptyFor(id)); } return(new VehicleRecord() { Id = id }); }
public static bool TryGetName(JsonString id, out VehicleRecord name) { return(VehicleIdToName.TryGetValue(id, out name)); }