예제 #1
0
        static public void Read(BinaryReader br)
        {
            string header = br.ReadString();

            if (header != "MAIN")
            {
                throw new FileNotFoundException("Invalid file passed to MainRegistry.FillFromFile()!");
            }

            int length = br.ReadInt32();

            Clear();

            for (int i = 0; i < length; ++i)
            {
                string filename = br.ReadString();
                double xSize    = br.ReadDouble();
                double ySize    = br.ReadDouble();

                var gi = new GraphicInfo(filename, xSize, ySize);
                AddEntry(gi);
            }
        }
예제 #2
0
 static public int AddEntry(GraphicInfo obj)
 {
     typeMap.Add(obj);
     codeMap.Add(obj, typeMap.Count - 1);
     return(typeMap.Count - 1);
 }
예제 #3
0
 static public int GetGraphicCode(GraphicInfo obj)
 {
     return(codeMap[obj]);
 }