コード例 #1
0
        public static VehicleRecord GetName(JsonString id)
        {
            VehicleRecord name;

            if (VehicleIdToName.TryGetValue(id, out name))
            {
                return(name);
            }
            return(VehicleRecord.EmptyFor(id));
        }
コード例 #2
0
 /// <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
     });
 }
コード例 #3
0
 public static bool TryGetName(JsonString id, out VehicleRecord name)
 {
     return(VehicleIdToName.TryGetValue(id, out name));
 }