Exemplo n.º 1
0
        private bool LoadSourceMultiMul()
        {
            FileStream    file   = new FileStream(mPatchInfo.MultiMul, FileMode.Open, FileAccess.Read, FileShare.Read);
            BinaryReader  reader = new BinaryReader(file);
            MultiDataFile data;
            bool          Success = false;

            try
            {
                while (reader.BaseStream.Position < reader.BaseStream.Length)
                {
                    data = new MultiDataFile();

                    data.ItemID = reader.ReadInt16();

                    data.X         = reader.ReadInt16();
                    data.Y         = reader.ReadInt16();
                    data.Z         = reader.ReadInt16();
                    data.IsVisible = reader.ReadInt32();

                    mItemBlocks.Add(data);
                }

                Success = true;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
            finally
            {
                reader.Close();
                file.Close();
                Success = false;
            }

            if (mIndexes.Count > 0)
            {
                Success = true;
            }
            else
            {
                Success = false;
            }

            return(Success);
        }
Exemplo n.º 2
0
        private void AddBlocksToMultiMul()
        {
            MultiDataFile data;

            if (mDesign.Items.Count > 0)
            {
                data = new MultiDataFile();

                data.ItemID    = 1;
                data.X         = 0;
                data.Y         = 0;
                data.Z         = 0;
                data.IsVisible = 0;

                mItemBlocks.Add(data);
            }

            foreach (DesignItem block in mDesign.Items)
            {
                data = new MultiDataFile();

                data.ItemID = (short)block.ItemID;
                data.X      = (short)block.X;
                data.Y      = (short)block.Y;
                data.Z      = (short)block.Z;

                if (mComponents != null && mComponents.Contains((int)data.ItemID))
                {
                    data.IsVisible = 0;
                }
                else
                {
                    data.IsVisible = 1;
                }

                mItemBlocks.Add(data);
            }
        }