Exemple #1
0
        public Cell(BigEndianReader raw, sbyte mapVersion)
        {
            cellId        = raw.ReadShort();
            elementsCount = raw.ReadShort();
            elements      = new List <BasicElement>();

            for (int i = 0; i < elementsCount; i++)
            {
                elements.Add(BasicElement.GetElementFromType(raw.ReadByte(), raw, mapVersion));
            }
        }
Exemple #2
0
 // Methods
 internal void Init(IDataReader Reader, int MapVersion)
 {
     CellId        = Reader.ReadShort();
     ElementsCount = Reader.ReadShort();
     for (var i = 0; i < ElementsCount; i++)
     {
         var be = BasicElement.GetElementFromType(Reader.ReadByte());
         be.Init(Reader, MapVersion);
         Elements.Add(be);
     }
 }
Exemple #3
0
        private void Read(FastBigEndianReader reader)
        {
            List <IElement> allElements = new List <IElement>();

            this.CellId        = reader.ReadShort();
            this.ElementsCount = reader.ReadShort();
            for (int i = 0; i < ElementsCount; i++)
            {
                IElement be = BasicElement.GetElementFromType(Map, reader, reader.ReadByte());
                allElements.Add(be);
            }
            Elements = allElements.AsReadOnly();
        }
Exemple #4
0
        // Methods
        internal void Init(BigEndianReader Reader, int MapVersion)
        {
            this.CellId        = Reader.ReadShort();
            this.ElementsCount = Reader.ReadShort();
            int elementsCount = this.ElementsCount;

            for (int i = 0; i < elementsCount; i++)
            {
                BasicElement elementFromType = BasicElement.GetElementFromType(Reader.ReadByte());
                elementFromType.Init(Reader, MapVersion);
                this.Elements.Add(elementFromType);
            }
        }
Exemple #5
0
        // Methods
        internal void Init(BigEndianReader Reader, int MapVersion)
        {
            CellId        = Reader.ReadShort();
            ElementsCount = Reader.ReadShort();
            int elementsCount = ElementsCount;
            int i             = 1;

            while ((i <= elementsCount))
            {
                BasicElement elementFromType = BasicElement.GetElementFromType(Reader.ReadByte());
                elementFromType.Init(Reader, MapVersion);
                Elements.Add(elementFromType);
                i += 1;
            }
        }
Exemple #6
0
        public Cell FromRaw(BigEndianReader raw)
        {
            Cell cell = new Cell
            {
                CellId        = raw.ReadShort(),
                ElementsCount = raw.ReadShort()
            };

            cell.Elements = new BasicElement[cell.ElementsCount];
            for (int i = 0; i < cell.ElementsCount; i++)
            {
                BasicElement be = new BasicElement(cell);
                cell.Elements[i] = be.GetElementFromType(cell, raw);
            }
            return(cell);
        }
Exemple #7
0
 // METHODS
 public void FromRaw(IDataReader reader, int mapVersion)
 {
     try
     {
         this.cellId        = reader.ReadShort();
         this.elementsCount = reader.ReadShort();
         this.elements      = new List <BasicElement>();
         for (int i = 0; i < this.elementsCount; i++)
         {
             var be = BasicElement.GetElementFromType(reader.ReadByte(), this);
             be.FromRaw(reader, mapVersion);
             this.elements.Add(be);
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Exemple #8
0
        public void FromRaw(BigEndianReader param1, int param2)
        {
            BigEndianReader bigEndianReader = param1;
            int             num             = param2;

            try
            {
                this.CellId        = (int)bigEndianReader.ReadShort();
                this.ElementsCount = (int)bigEndianReader.ReadShort();
                this.Elements      = new BasicElement[this.ElementsCount];
                for (int index = 0; index < this.ElementsCount; ++index)
                {
                    BasicElement elementFromType = BasicElement.GetElementFromType((int)bigEndianReader.ReadByte(), this);
                    elementFromType.FromRaw(bigEndianReader, num);
                    this.Elements[index] = elementFromType;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine((object)ex);
                throw;
            }
        }