Пример #1
0
        private bool CanFillTrees(ref TextureProperties prop, int x, int y)
        {
            var center = _wd.ForestShowData[x][y];
            if (center == ForestGenerator.None)
                return false;
            //var temperature = _wd.TempData[x][y];
            var vals = GetDataOther(_wd.ForestShowData, x, y);

            var textureName = "";

            //switch (temperature)
            //{
            //    case TemperatureGenerator.Cold:
            //        textureName = "trees_snow";
            //        break;
            //    case TemperatureGenerator.Mild:
                    textureName = "trees_plain";
            //        break;
            //    case TemperatureGenerator.Warm:
            //        textureName = "trees_jungle";
            //        break;
            //    case TemperatureGenerator.Hot:
            //        textureName = "trees_desert";
            //        break;
            //}

            //return SetBounds(textureName, ref _landFeature, vals, x, y);
            prop.SetLocations(textureName, vals);
            return true;
        }
Пример #2
0
        private void FillHeight(ref TextureProperties prop, int x, int y)
        {
            var center = _wd.HeightShowData[x][y];

            var vals = GetData(_wd.HeightShowData, x, y, center);
            //var temperature = _wd.TempData[x][y];

            var textureName = "";
            //if (temperature == TemperatureGenerator.Frozen || temperature == TemperatureGenerator.Cold)
            //{
            //    switch (center)
            //    {
            //        case HeightGenerator.DeepOcean:
            //        case HeightGenerator.Ocean:
            //        case HeightGenerator.ShallowOcean:
            //            textureName = "water_snow";
            //            break;
            //        case HeightGenerator.Beach:
            //            textureName = "beach";
            //            break;
            //        case HeightGenerator.Plains:
            //        case HeightGenerator.Hills:
            //        case HeightGenerator.Mountains:
            //            textureName = "snow";
            //            break;
            //    }
            //}
            //else
            //{
                switch (center)
                {
                    case HeightGenerator.DeepOcean:
                        textureName = "water_deep";
                        break;
                    case HeightGenerator.Ocean:
                        textureName = "water_ocean";
                        break;
                    case HeightGenerator.ShallowOcean:
                        textureName = "water_shallow";
                        break;
                    case HeightGenerator.Beach:
                        textureName = "beach";
                        break;
                    case HeightGenerator.Plains:
                    case HeightGenerator.Hills:
                    case HeightGenerator.Mountains:
                        textureName = "plains";
                        break;
                }
            //}

            //SetBounds(textureName, ref _land, vals, x, y);

            prop.SetLocations(textureName, vals);
        }
Пример #3
0
        private bool CanFillMountains(ref TextureProperties prop, int x, int y)
        {
            var center = _wd.HeightShowData[x][y];
            if (center != HeightGenerator.Hills && center != HeightGenerator.Mountains) return false;

               // var temperature = _wd.TempData[x][y];
            var forest = _wd.ForestData[x][y];
            var textureName = center == HeightGenerator.Hills ? "hill_" : "mountain_";

            //switch (temperature)
            //{
            //    case TemperatureGenerator.Cold:
            //        textureName += "snow";
            //        break;
            //    case TemperatureGenerator.Mild:
                    textureName += "plain";
                 //   break;
            //    case TemperatureGenerator.Warm:
            //        textureName += "jungle";
            //        break;
            //    case TemperatureGenerator.Hot:
            //        textureName += "desert";
            //        break;
            //}

            if (center != HeightGenerator.Mountains)
                textureName = forest > ForestGenerator.None ? textureName + "_trees" : textureName;

            if (textureName.Length != 0)
            {
                prop.SetLocations(textureName, true);
                return true;
            }
            #if DEBUG
            else
                System.Diagnostics.Debug.WriteLine("Bad news, check mini tile manager");
            #endif
            return false;
        }