예제 #1
0
    /// <summary>
    /// <CSVD> Clod manager main import
    /// </summary>
    public bool Import(BinaryReader r)
    {
        int version = r.ReadInt32();

        if (version >= CSDataMgr.VERSION000)
        {
            int count = r.ReadInt32();
            for (int i = 0; i < count; i++)
            {
                ClodChunk cc = new ClodChunk();
                cc.Import(r, version);
                m_ClodChunks.Add(cc.m_ChunkIndex, cc);
                m_IdleChunks.Add(cc.m_ChunkIndex, 0);
            }

            count = r.ReadInt32();
            for (int i = 0; i < count; i++)
            {
                ClodChunk cc = new ClodChunk();
                cc.Import(r, version);
                m_ClodChunks.Add(cc.m_ChunkIndex, cc);
                if (cc.HasIdleClods())
                {
                    m_IdleChunks[cc.m_ChunkIndex] = 0;
                }
            }
        }
        return(true);
    }
예제 #2
0
    /// <summary>
    /// <CSVD> Clod manager main import
    /// </summary>
    public void Import(BinaryReader r)
    {
        int version = r.ReadInt32();

        //switch ( version )
        //{
        //case 0x0105:
        //case 0x0106:
        //case 0x0107:
        //{
        //    int count = r.ReadInt32();
        //    for (int i = 0; i < count; i++)
        //    {
        //        Vector3 vec = new Vector3(r.ReadSingle(), r.ReadSingle(), r.ReadSingle());
        //        IntVec3 index_pos = new IntVec3(vec);
        //        m_ClodLocas.Add(index_pos,vec);
        //        m_IdleClods.Add(index_pos, 0);
        //    }

        //    count = r.ReadInt32();
        //    for (int i = 0; i < count; i++)
        //    {
        //        Vector3 vec = new Vector3(r.ReadSingle(), r.ReadSingle(), r.ReadSingle());
        //        IntVec3 index_pos = new IntVec3(vec);
        //        m_ClodLocas.Add(index_pos, vec);
        //    }
        //}
        //return true;
        //case 0x0108:
        //case 0x0109:
        //case 0x0110:
        //case 0x0111:
        //case 0x0112:
        //case 0x0113:
        //case 0x0114:
        //case 0x0115:
        //case 0x0116:
        //{
        if (version >= CSDataMgr.VERSION000)
        {
            int count = r.ReadInt32();
            for (int i = 0; i < count; i++)
            {
                ClodChunk cc = new ClodChunk();
                cc.Import(r, version);
                m_ClodChunks.Add(cc.m_ChunkIndex, cc);
                m_IdleChunks.Add(cc.m_ChunkIndex, 0);
            }

            count = r.ReadInt32();
            for (int i = 0; i < count; i++)
            {
                ClodChunk cc = new ClodChunk();
                cc.Import(r, version);
                m_ClodChunks.Add(cc.m_ChunkIndex, cc);
                if (cc.HasIdleClods())
                {
                    m_IdleChunks[cc.m_ChunkIndex] = 0;
                }
            }
        }

        //}
        //return true;
        //default:
        //    break;
        //}

        //return false;
    }