Exemple #1
0
 static private int GetCode(string name, double width, double height)
 {
     if (codeDictionary.ContainsKey(name))
     {
         return(codeDictionary[name]);
     }
     else
     {
         int code = Registry.AddEntry(new GraphicInfo(filenameDictionary[name], width, height));
         codeDictionary.Add(name, code);
         return(code);
     }
 }
 private static int GetCode(Intelligence intel, double width, double height)
 {
     lock (locker)
     {
         var type = intel.GetType();
         if (!speciesCodes.ContainsKey(type))
         {
             int code = Registry.AddEntry(new GraphicInfo(intel.BitmapFilename, width, height));
             AddCodes(type, code, speciesCode++);
         }
         return(speciesCodes[type].GraphicsCode);
     }
 }