コード例 #1
0
 public GliderRoutes(GLPT data, GLPH paths)
 {
     foreach (var path in paths.Entries)
     {
         Entries.Add(new GliderGroup(path, data));
     }
 }
コード例 #2
0
ファイル: KMP.cs プロジェクト: mariohackandglitch/KMPExpander
        public KMP(byte[] Data)
        {
            EndianBinaryReaderEx er = new EndianBinaryReaderEx(new MemoryStream(Data), Endianness.LittleEndian);

            try
            {
                Header = new KMPHeader(er);
                foreach (var v in Header.SectionOffsets)
                {
                    er.BaseStream.Position = Header.HeaderSize + v;
                    String sig = er.ReadString(Encoding.ASCII, 4);
                    er.BaseStream.Position -= 4;
                    switch (sig)
                    {
                    case "TPTK": KartPoint = new KTPT(er); break;

                    case "TPNE": EnemyPoint = new ENPT(er); break;

                    case "HPNE": EnemyPointPath = new ENPH(er); break;

                    case "TPTI": ItemPoint = new ITPT(er); break;

                    case "HPTI": ItemPointPath = new ITPH(er); break;

                    case "TPKC": CheckPoint = new CKPT(er); break;

                    case "HPKC": CheckPointPath = new CKPH(er); break;

                    case "JBOG": GlobalObject = new GOBJ(er); break;

                    case "ITOP": PointInfo = new POTI(er); break;

                    case "AERA": Area = new AREA(er); break;

                    case "EMAC": Camera = new CAME(er); break;

                    case "TPGJ": JugemPoint = new JGPT(er); break;

                    case "TPNC": CannonPoint = new CNPT(er); break;

                    case "TPSM": MissionPoint = new MSPT(er); break;

                    case "IGTS": StageInfo = new STGI(er); break;

                    case "SROC": CourseSect = new CORS(er); break;

                    case "TPLG": GliderPoint = new GLPT(er); break;

                    case "HPLG": GliderPointPath = new GLPH(er); break;

                    default: continue;
                    }
                }
            }
            finally
            {
                er.Close();
            }
        }
コード例 #3
0
        public GLPH ToGLPH()
        {
            GLPH path = new GLPH();

            path.NrEntries = (uint)Entries.Count;
            byte start = 0;

            foreach (var group in Entries)
            {
                path.Entries.Add(group.ToGLPHEntry(start));
                start += (byte)group.Entries.Count;
            }
            return(path);
        }