Ejemplo n.º 1
0
        public void Save(XmlTextWriter xmlInfo)
        {
            xmlInfo.WriteStartElement("Statics");
            xmlInfo.WriteAttributeString("Description", this.m_Description);
            xmlInfo.WriteAttributeString("Freq", StringType.FromInteger(this.m_Freq));

            IEnumerator enumerator = this.InnerList.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    RandomStatic randomStatic = (RandomStatic)enumerator.Current;
                    randomStatic.Save(xmlInfo);
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    ((IDisposable)enumerator).Dispose();
                }
            }
            xmlInfo.WriteEndElement();
        }
Ejemplo n.º 2
0
        public void RandomStatic(short X, short Y, short Z, Collection[,] StaticMap)
        {
            IEnumerator enumerator = this.InnerList.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    RandomStatic randomStatic = (RandomStatic)enumerator.Current;
                    StaticCell   item         = new StaticCell(randomStatic.TileID, checked ((byte)(unchecked (X + randomStatic.X) % 8)), checked ((byte)(unchecked (Y + randomStatic.Y) % 8)), (short)(Z + randomStatic.Z));
                    StaticMap[(int)((short)(X + randomStatic.X >> 3)), (int)((short)(Y + randomStatic.Y >> 3))].Add(item, null, null, null);
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    ((IDisposable)enumerator).Dispose();
                }
            }
        }
        public void Display(ListBox iList)
        {
            IEnumerator enumerator = null;

            iList.Items.Clear();
            try
            {
                enumerator = this.InnerList.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    RandomStatic current = (RandomStatic)enumerator.Current;
                    iList.Items.Add(current);
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    ((IDisposable)enumerator).Dispose();
                }
            }
        }
        public void RandomStatic(short X, short Y, short Z, Collection[,] StaticMap)
        {
            IEnumerator enumerator = null;

            try
            {
                enumerator = this.InnerList.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    RandomStatic current    = (RandomStatic)enumerator.Current;
                    StaticCell   staticCell = new StaticCell(current.TileID, checked ((byte)(checked ((short)(X + current.X)) % 8)), checked ((byte)(checked ((short)(Y + current.Y)) % 8)), checked ((short)(Z + current.Z)));
                    StaticMap[(short)(checked ((short)(X + current.X)) >> 3), (short)(checked ((short)(Y + current.Y)) >> 3)].Add(staticCell, null, null, null);
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    ((IDisposable)enumerator).Dispose();
                }
            }
        }
 public void Add(RandomStatic Value)
 {
     this.InnerList.Add(Value);
 }
 public void Remove(RandomStatic Value)
 {
     this.InnerList.Remove(Value);
 }
 public void Remove(RandomStatic Value)
 {
     this.InnerList.Remove((object) Value);
 }
 public void Add(RandomStatic Value)
 {
     this.InnerList.Add((object) Value);
 }