Beispiel #1
0
        void CommonInit(bool init)
        {
            m_randomXYArray = new uint[this.Width * this.Height];
            for (int i = 0; i < m_randomXYArray.Length; ++i)
            {
                ushort x = (ushort)(i % this.Width);
                ushort y = (ushort)(i / this.Width);
                m_randomXYArray[i] = ((uint)x << 16) | y;
            }
            MyMath.ShuffleArray(m_randomXYArray, this.World.Random);

            if (this.World.GameMode == GameMode.Fortress)
            {
                m_treeHandler     = new EnvTreeHandler(this, m_originalNumTrees);
                m_wildlifeHandler = new EnvWildlifeHandler(this);
                if (init)
                {
                    m_wildlifeHandler.Init();
                }
            }

            m_waterHandler = new EnvWaterHandler(this);
        }
Beispiel #2
0
        void CommonInit(bool init)
        {
            m_randomXYArray = new uint[this.Width * this.Height];
            for (int i = 0; i < m_randomXYArray.Length; ++i)
            {
                ushort x = (ushort)(i % this.Width);
                ushort y = (ushort)(i / this.Width);
                m_randomXYArray[i] = ((uint)x << 16) | y;
            }
            MyMath.ShuffleArray(m_randomXYArray, this.World.Random);

            if (this.World.GameMode == GameMode.Fortress)
            {
                m_treeHandler = new EnvTreeHandler(this, m_originalNumTrees);
                m_wildlifeHandler = new EnvWildlifeHandler(this);
                if (init)
                    m_wildlifeHandler.Init();
            }

            m_waterHandler = new EnvWaterHandler(this);
        }