コード例 #1
0
        void IMyStorageDataProvider.WriteTo(Stream stream)
        {
            stream.WriteNoAlloc(m_state.Version);
            stream.WriteNoAlloc(m_state.Generator);
            stream.WriteNoAlloc(m_state.Seed);
            stream.WriteNoAlloc(m_state.Size);
            stream.WriteNoAlloc(m_state.IsPlanet);

            if (m_state.IsPlanet == 1)
            { // DA: Try to reduce saved data for planets to just seed, as is done for normal asteroids.
                m_materialAttributes.WriteTo(stream);
                m_shapeAttributes.WriteTo(stream);
                stream.WriteNoAlloc(m_maxHillHeight);
            }
        }