public void InitializeTest()
        {
            var array = new List<object>[5];

            foreach (var value in array)
                Assert.Null(value);

            array.Initialize<List<object>>();

            foreach (var value in array)
                Assert.NotNull(value);
        }
Example #2
0
        /// <summary>
        /// Class costructor
        /// </summary>
        /// <param name="map">map cached previusly</param>
        /// <param name="alt">map altitude cached</param>
        /// <param name="x">max x of the map</param>
        /// <param name="y">max y of the map</param>
        /// <param name="index">index of the map</param>
        public MapMaker(Color[] map, Color[] alt, int x, int y,int index)
        {
            BitmapMap = map;
            BitmapMapZ = alt;
            var x1 = x + 10;
            var y1 = y + 10;
            var lenght = x1*y1;
            #region InitArrays
            _MapOcc = new int[lenght];
            _MapOcc.Initialize();

            _MapAlt = new int[lenght];
            _MapAlt.Initialize();

            _MapID = new int[x1*y1];
            _MapID.Initialize();

            _AddItemMap = new List<Item>[lenght];
            _AddItemMap.Initialize();

            _Tmp = new Color[lenght];
            _Tmp.Initialize();

            #endregion

            _X = x;
            _Y = y;

            MulDirectory = "";
            mapIndex = index;
            _stride = _X - 1;
            Random = new Random(DateTime.Now.Millisecond);

            AutomaticZMode = true;
        }