Example #1
0
        public static CelestialLog FromStream(IStarboundStream stream)
        {
            CelestialLog log = new CelestialLog();

            byte[] logDat = stream.ReadUInt8Array();

            using (StarboundStream s = new StarboundStream(logDat))
            {
                uint visited = s.ReadUInt32();

                for (int i = 0; i < visited; i++)
                {
                    log.Visited.Add(s.ReadSystemCoordinate());
                }

                uint sectors = s.ReadUInt32();

                for (int i = 0; i < sectors; i++)
                {
                    log.Sectors.Add(new LogSector {
                        SectorName = s.ReadString(), Unknown = s.ReadBoolean()
                    });
                }

                s.ReadUInt8(); //unknown

                log.CurrentSystem   = s.ReadSystemCoordinate();
                log.CurrentLocation = s.ReadWorldCoordinate();
                log.HomeCoordinate  = s.ReadWorldCoordinate();
            }

            return(log);
        }