Exemple #1
0
 private static bool PlaceDoubleBorder
     (
     AreaColorCoordinates areaColorCoordinates,
     MapObjectCoordinates mapObjectCoordinates,
     Coordinates coordinates,
     TypeColor type,
     sbyte zItem,
     sbyte altitude,
     int itemid,
     AreaColor border,
     AreaColor border2,
     int texture = -1,
     bool ground = false,
     bool occupied = true,
     int hue = 0
     )
 {
     return areaColorCoordinates.List.Count(o => o.Type == type && o != border && o != border2) == 7 && mapObjectCoordinates.PlaceObjectOcc(areaColorCoordinates, altitude, itemid, zItem, texture, ground,occupied,hue);
 }
Exemple #2
0
        private void MakeCoastUolStyle
            (
            AreaColorCoordinates areaColorCoordinates,
            MapObjectCoordinates mapObjectCoordinates,
            Coordinates coordinates,
            Random random
            )
        {
            if (areaColorCoordinates.Center.Type == TypeColor.Water) return;

            var hue = areaColorCoordinates.Center.Coasts.Coast.Hue;
            if (areaColorCoordinates.List.All(o => o.Type != TypeColor.WaterCoast))
                return;

            #region WaterCoasts
            if (areaColorCoordinates.Center.Type == TypeColor.WaterCoast)
            {
                mapObjectCoordinates.PlaceObjectOcc(areaColorCoordinates,
                    (sbyte)random.Next(areaColorCoordinates.Center.Min, areaColorCoordinates.Center.Max),
                    areaColorCoordinates.Center.CliffCoast?areaColorCoordinates.Center.Coasts.Coast.Texture:(int)SpecialAboutItems.Nothing,
                    (sbyte)areaColorCoordinates.Center.ItemsAltitude,
                           RandomTexture(areaColorCoordinates.Center.TextureIndex, random),true,true,hue);

                if (areaColorCoordinates.List.All(o => o.Type == TypeColor.WaterCoast || o.Type == TypeColor.Water))
                {
                    mapObjectCoordinates.PlaceObjectOcc(
                        areaColorCoordinates,
                        (sbyte)random.Next(areaColorCoordinates.Center.Min,areaColorCoordinates.Center.Max),
                        areaColorCoordinates.Center.CliffCoast?areaColorCoordinates.Center.Coasts.Coast.Texture:(int)SpecialAboutItems.Nothing,
                        (sbyte)areaColorCoordinates.Center.ItemsAltitude,
                            RandomTexture(areaColorCoordinates.Center.TextureIndex, random), false,true,hue);
                    return;
                }

                #region Borders
                if
                (
                    PlaceObjectBorder
                    (
                    areaColorCoordinates,
                    mapObjectCoordinates,
                    coordinates,
                    areaColorCoordinates.Center.Type,
                    (sbyte)areaColorCoordinates.Center.CoastAltitude,
                    (sbyte)random.Next(areaColorCoordinates.Center.Min,areaColorCoordinates.Center.Max),
                    areaColorCoordinates.Center.Coasts.Coast.Texture,
                    areaColorCoordinates.NorthWest,-1,false,true,hue
                    )
                )
                {
                    if(DebugWater)
                        mapObjectCoordinates.Center.Altitude = 65;

                    if (areaColorCoordinates.North.CliffCoast)
                    mapObjectCoordinates.Center.Texture =(short)
                        RandomFromList(areaColorCoordinates.North.Coasts.Ground.BorderNorthEast.List, random);
                    return;
                    
                }

                if
                (
                    PlaceObjectBorder
                    (
                    areaColorCoordinates,
                    mapObjectCoordinates,
                    coordinates,
                    areaColorCoordinates.Center.Type,
                    (sbyte)areaColorCoordinates.Center.ItemsAltitude,
                    (sbyte)random.Next(areaColorCoordinates.Center.Min, areaColorCoordinates.Center.Max),
                    areaColorCoordinates.Center.Coasts.Coast.Texture,
                    areaColorCoordinates.SouthEast, -1, false, true, hue
                    )
                )
                {
                    if (DebugWater)
                    mapObjectCoordinates.Center.Altitude = 70;
                    return;
                }
                if
                (
                    PlaceObjectBorder
                    (
                    areaColorCoordinates,
                    mapObjectCoordinates,
                    coordinates,
                    areaColorCoordinates.Center.Type,
                    (sbyte)areaColorCoordinates.Center.ItemsAltitude,
                    (sbyte)random.Next(areaColorCoordinates.Center.Min, areaColorCoordinates.Center.Max),
                    areaColorCoordinates.Center.Coasts.Coast.Texture,
                    areaColorCoordinates.NorthEast, -1, false, true, hue
                    )
                )
                {
                    if (DebugWater)
                        mapObjectCoordinates.Center.Altitude = 75;
                    return;
                    
                }

                if
                (
                    PlaceObjectBorder
                    (
                    areaColorCoordinates,
                    mapObjectCoordinates,
                    coordinates,
                    areaColorCoordinates.Center.Type,
                    (sbyte)areaColorCoordinates.Center.ItemsAltitude,
                    (sbyte)random.Next(areaColorCoordinates.Center.Min, areaColorCoordinates.Center.Max),
                    areaColorCoordinates.Center.Coasts.Coast.Texture,
                    areaColorCoordinates.SouthWest, -1, false, true, hue
                    )
                )
                {
                    if (DebugWater)
                        mapObjectCoordinates.Center.Altitude = 80;
                    return;
                }
                #endregion //Borders

                #region Edges

                if
                (
                    PlaceObjectNorthWestEdge
                    (
                    areaColorCoordinates,
                    mapObjectCoordinates,
                    coordinates,
                    areaColorCoordinates.Center.Type,
                    //-5,
                    (sbyte)areaColorCoordinates.Center.ItemsAltitude,
                    (sbyte)random.Next(areaColorCoordinates.Center.Min, areaColorCoordinates.Center.Max),
                    //-15, non per le coste basse
                    //-5,
                    areaColorCoordinates.Center.Coasts.Coast.Texture, -1, false, true, hue
                    )
                )
                {
                    if (DebugWater)
                        mapObjectCoordinates.Center.Altitude = 85;
                    if (areaColorCoordinates.North.CliffCoast)//non sicuro
                    mapObjectCoordinates.Center.Texture =(short)
                        RandomFromList(areaColorCoordinates.North.Coasts.Ground.BorderNorthEast.List, random);
                    return;
                }

                if
                (
                    PlaceObjectSouthWestEdge
                    (
                    areaColorCoordinates,
                    mapObjectCoordinates,
                    coordinates,
                    areaColorCoordinates.Center.Type,
                    (sbyte)areaColorCoordinates.Center.ItemsAltitude,
                    (sbyte)random.Next(areaColorCoordinates.Center.Min, areaColorCoordinates.Center.Max),
                    //-5,
                    //-15, non per le coste basse
                    //-5,
                    areaColorCoordinates.Center.Coasts.Coast.Texture,
                    random, -1, false, true, hue
                    )
                )
                {
                    if (DebugWater)
                        mapObjectCoordinates.Center.Altitude = 90;
                    return;
                }


                if
                (
                    PlaceObjectSouthEastEdge
                    (
                    areaColorCoordinates,
                    mapObjectCoordinates,
                    coordinates,
                    areaColorCoordinates.Center.Type,
                     (sbyte)areaColorCoordinates.Center.ItemsAltitude,
                    (sbyte)random.Next(areaColorCoordinates.Center.Min, areaColorCoordinates.Center.Max),
                    //-5,
                    //-15, non per le coste
                    //-5,
                    areaColorCoordinates.Center.Coasts.Coast.Texture, -1, false, true, hue
                    )
                )
                {
                    if (DebugWater)
                        mapObjectCoordinates.Center.Altitude = 90;
                    return;
                }


                if
                (
                    PlaceObjectNorthEastEdge
                    (
                    areaColorCoordinates,
                    mapObjectCoordinates,
                    coordinates,
                    areaColorCoordinates.Center.Type,
                    //-5,
                    //-15,
                     (sbyte)areaColorCoordinates.Center.ItemsAltitude,
                    (sbyte)random.Next(areaColorCoordinates.Center.Min, areaColorCoordinates.Center.Max),
                    areaColorCoordinates.Center.Coasts.Coast.Texture,
                    random, -1, false, true, hue
                    )
                )
                {
                    if (DebugWater)
                        mapObjectCoordinates.Center.Altitude = 95;
                    return;
                }
                #endregion //edges

                #region Lines
                if
                (
                    PlaceObjectSouth
                    (
                    areaColorCoordinates,
                    mapObjectCoordinates,
                    coordinates,
                    areaColorCoordinates.Center.Type,
                    //-5,
                    //-15,
                     (sbyte)areaColorCoordinates.Center.ItemsAltitude,
                    (sbyte)random.Next(areaColorCoordinates.Center.Min, areaColorCoordinates.Center.Max),
                    areaColorCoordinates.Center.Coasts.Coast.Texture, -1, false, true, hue
                    )
                )
                {
                    if (DebugWater)
                        mapObjectCoordinates.Center.Altitude = 100;
                    return;
                }


                if
                (
                    PlaceObjectWest
                    (
                    areaColorCoordinates,
                    mapObjectCoordinates,
                    coordinates,
                    areaColorCoordinates.Center.Type,
                    //-5,
                    //-15,
                     (sbyte)areaColorCoordinates.Center.ItemsAltitude,
                    (sbyte)random.Next(areaColorCoordinates.Center.Min, areaColorCoordinates.Center.Max),
                    areaColorCoordinates.Center.Coasts.Coast.Texture,
                    random, -1, false, true, hue
                    )
                )
                {
                    if (DebugWater)
                        mapObjectCoordinates.Center.Altitude = 100;
                    return;
                }


                if
                (
                    PlaceObjectEast
                    (
                    areaColorCoordinates,
                    mapObjectCoordinates,
                    coordinates,
                    areaColorCoordinates.Center.Type,
                    //-5,
                    //-15,
                     (sbyte)areaColorCoordinates.Center.ItemsAltitude,
                    (sbyte)random.Next(areaColorCoordinates.Center.Min, areaColorCoordinates.Center.Max),
                    areaColorCoordinates.Center.Coasts.Coast.Texture, -1, false, true, hue
                    )
                )
                {
                    if (DebugWater)
                        mapObjectCoordinates.Center.Altitude = 105;
                    return;
                }


                if
                (
                    PlaceObjectNorth
                    (
                    areaColorCoordinates,
                    mapObjectCoordinates,
                    coordinates,
                    areaColorCoordinates.Center.Type,
                    //-5,
                    //-15,
                     (sbyte)areaColorCoordinates.Center.ItemsAltitude,
                    (sbyte)random.Next(areaColorCoordinates.Center.Min, areaColorCoordinates.Center.Max),
                    areaColorCoordinates.Center.Coasts.Coast.Texture,
                    random, -1, false, true, hue
                    )
                )
                {
                    if (DebugWater)
                        mapObjectCoordinates.Center.Altitude = 110;
                    return;
                }
                #endregion //Lines

                return;
            }
            #endregion //watercoasts

            #region casual

            #region BORDER

            #region NORTH WEST
            //NWB corretto
            if (
                PlaceObjectBorder(areaColorCoordinates,
                                  mapObjectCoordinates,
                                  coordinates,
                                  areaColorCoordinates.Center.Type,
                                  (sbyte)areaColorCoordinates.Center.CoastAltitude,
                                  (sbyte)areaColorCoordinates.Center.MinCoastTextureZ,
                                  RandomFromList(areaColorCoordinates.Center.Coasts.Coast.EdgeNorthWest.List, random),
                                  areaColorCoordinates.NorthWest,
                                  RandomFromList(areaColorCoordinates.Center.Coasts.Ground.EdgeNorthWest.List, random), 
                                  areaColorCoordinates.Center.CliffCoast,true,hue))
            {
                if(DebugCoast)
                    mapObjectCoordinates.Center.Altitude = 40;

                if (areaColorCoordinates.Center.CliffCoast && !DebugCoast)
                    mapObjectCoordinates.SouthEast.Altitude =
                        (sbyte)(random.Next(areaColorCoordinates.SouthEast.Min, areaColorCoordinates.SouthEast.Max) + random.Next(1, 5));



                if (!DebugCoast && !areaColorCoordinates.Center.CliffCoast)
                    SouthEastSmooth(coordinates, _X, _Y, _stride, _bitmapAreaColor, _mapObjects, random);
                return;
            }
            #endregion

            #region NORTH EAST
            //NEB
            if (
                PlaceObjectBorder(
                    areaColorCoordinates,
                    mapObjectCoordinates,
                    coordinates,
                    areaColorCoordinates.Center.Type,
                    (sbyte)areaColorCoordinates.Center.CoastAltitude,
                    areaColorCoordinates.Center.CliffCoast ? (sbyte)(random.Next(areaColorCoordinates.Center.Min,areaColorCoordinates.Center.Max)+random.Next(-2,3)) :
                    (sbyte)areaColorCoordinates.Center.MinCoastTextureZ,
                    RandomFromList(areaColorCoordinates.Center.Coasts.Coast.EdgeNorthEast.List, random),
                    areaColorCoordinates.NorthEast,
                    RandomFromList(areaColorCoordinates.Center.Coasts.Ground.EdgeNorthEast.List, random),
                    areaColorCoordinates.Center.CliffCoast, true, hue
                    ))
            {
                if (!DebugCoast && !areaColorCoordinates.Center.CliffCoast)
                    SouthEastSmooth(coordinates, _X, _Y, _stride, _bitmapAreaColor, _mapObjects, random);
                //OK
                if(DebugCoast)
                    mapObjectCoordinates.Center.Altitude = 35;
                
                return;
            }

            #endregion //NEB

            #region SOUTH EAST
            //SEB
            if (
                PlaceObjectBorder(
                    areaColorCoordinates,
                    mapObjectCoordinates,
                    coordinates,
                    areaColorCoordinates.Center.Type,
                    (sbyte)areaColorCoordinates.Center.CoastAltitude,
                    areaColorCoordinates.Center.CliffCoast ? (sbyte)(random.Next(areaColorCoordinates.Center.Min, areaColorCoordinates.Center.Max) + random.Next(-3, -1)) :
                    (sbyte)areaColorCoordinates.Center.MinCoastTextureZ,
                    RandomFromList(areaColorCoordinates.Center.Coasts.Coast.EdgeSouthEast.List, random),
                    areaColorCoordinates.SouthEast,
                    RandomFromList(areaColorCoordinates.Center.Coasts.Ground.EdgeSouthEast.List, random),
                    areaColorCoordinates.Center.CliffCoast, true, hue))
            {
                if(DebugCoast)
                    mapObjectCoordinates.Center.Altitude = 30;
                return;
            }

            #endregion //SEB

            #region SOUTHWEST
            //SWB
            if (
                PlaceObjectBorder(
                    areaColorCoordinates,
                    mapObjectCoordinates,
                    coordinates,
                    areaColorCoordinates.Center.Type,
                    (sbyte)areaColorCoordinates.Center.CoastAltitude,
                    areaColorCoordinates.Center.CliffCoast ? (sbyte)(random.Next(areaColorCoordinates.Center.Min, areaColorCoordinates.Center.Max) + random.Next(-3, -1)) :
                    (sbyte)areaColorCoordinates.Center.MinCoastTextureZ,
                    RandomFromList(areaColorCoordinates.Center.Coasts.Coast.EdgeSouthWest.List, random),
                    areaColorCoordinates.SouthWest,
                    RandomFromList(areaColorCoordinates.Center.Coasts.Ground.EdgeSouthWest.List, random),
                    areaColorCoordinates.Center.CliffCoast, true, hue))
            {
                if(DebugCoast)
                    mapObjectCoordinates.Center.Altitude = 25;
                return;
            }

            #endregion //SWB

            #endregion //BORDER


            #region Double Border
            //INS
            if (PlaceDoubleBorder(areaColorCoordinates, mapObjectCoordinates, coordinates,
                                  areaColorCoordinates.Center.Type, 0, 0, 0, areaColorCoordinates.SouthWest,
                                  areaColorCoordinates.NorthWest,
                                  RandomFromList(areaColorCoordinates.Center.Coasts.Ground.BorderSouthWest.List, random), true, true, hue))
                return;
            //IWE
            if (PlaceDoubleBorder(areaColorCoordinates, mapObjectCoordinates, coordinates,
                                  areaColorCoordinates.Center.Type, 0, 0, 0, areaColorCoordinates.NorthWest,
                                  areaColorCoordinates.SouthEast,
                                  RandomFromList(areaColorCoordinates.Center.Coasts.Ground.BorderSouthWest.List, random), true, true, hue))
                return;
            #endregion //DOUBLE BORDER


            #region Lines

            #region NORTH
            if (
                PlaceObjectNorth(areaColorCoordinates,
                              mapObjectCoordinates,
                              coordinates,
                              areaColorCoordinates.Center.Type,
                              (sbyte)areaColorCoordinates.Center.CoastAltitude,
                              (sbyte)areaColorCoordinates.Center.MinCoastTextureZ,
                               RandomFromList(areaColorCoordinates.Center.Coasts.Coast.LineNorth.List, random),
                              random,
                              RandomFromList(areaColorCoordinates.Center.Coasts.Ground.LineNorth.List, random),
                              areaColorCoordinates.Center.CliffCoast, true, hue))
            {
               if (areaColorCoordinates.Center.CliffCoast && !DebugCoast)
                    mapObjectCoordinates.South.Altitude =
                        (sbyte)(random.Next((areaColorCoordinates.South.Min), areaColorCoordinates.South.Max) +
                                 random.Next(-3, 0));
               if (!DebugCoast && !areaColorCoordinates.Center.CliffCoast)
                   SouthSmooth(coordinates, _X, _Y, _stride, _bitmapAreaColor, _mapObjects, random);
                if(DebugCoast)
                    mapObjectCoordinates.Center.Altitude = 60;
                return;

            }
            #endregion //NORTH

            #region WEST

            if (
                PlaceObjectWest(areaColorCoordinates,
                              mapObjectCoordinates,
                              coordinates,
                              areaColorCoordinates.Center.Type,
                              (sbyte)areaColorCoordinates.Center.CoastAltitude,
                               (sbyte)areaColorCoordinates.Center.MinCoastTextureZ,
                               RandomFromList(areaColorCoordinates.Center.Coasts.Coast.LineWest.List, random),
                              random,
                              RandomFromList(areaColorCoordinates.Center.Coasts.Ground.LineWest.List, random), areaColorCoordinates.Center.CliffCoast, true, hue))
            {
                if (areaColorCoordinates.Center.CliffCoast && !DebugCoast)
                    mapObjectCoordinates.East.Altitude =
                        (sbyte) (random.Next((areaColorCoordinates.East.Min), areaColorCoordinates.East.Max) +
                                 random.Next(-3, -2));

                if (!DebugCoast && !areaColorCoordinates.Center.CliffCoast)
                    SouthEastSmooth(coordinates, _X, _Y, _stride, _bitmapAreaColor, _mapObjects, random);
                //OK
                if(DebugCoast)
                    mapObjectCoordinates.Center.Altitude = 45;
                return;
            }

            #endregion //WEST

            #region EAST

            if (
                PlaceObjectEast(
                areaColorCoordinates,
                              mapObjectCoordinates,
                              coordinates,
                              areaColorCoordinates.Center.Type,
                              (sbyte)areaColorCoordinates.Center.CoastAltitude,
                              areaColorCoordinates.Center.CliffCoast?(sbyte)(random.Next(areaColorCoordinates.Center.Min,areaColorCoordinates.Center.Max) +random.Next(-2,5))
                              :(sbyte)areaColorCoordinates.Center.MinCoastTextureZ,
                              RandomFromList(areaColorCoordinates.Center.Coasts.Coast.LineEast.List, random),
                              RandomFromList(areaColorCoordinates.Center.Coasts.Ground.LineEast.List, random), areaColorCoordinates.Center.CliffCoast, true, hue))
            {
                if (!DebugCoast && !areaColorCoordinates.Center.CliffCoast)
                    WestSmooth(coordinates, _X, _Y, _stride, _bitmapAreaColor, _mapObjects, random);
                if(DebugCoast)
                    mapObjectCoordinates.Center.Altitude = 50;
                return;

            }

            #endregion //EAST

            #region SOUTH

            if (
                PlaceObjectSouth(areaColorCoordinates,
                              mapObjectCoordinates,
                              coordinates,
                              areaColorCoordinates.Center.Type,
                              (sbyte)areaColorCoordinates.Center.CoastAltitude,
                              areaColorCoordinates.Center.CliffCoast?(sbyte)(random.Next(areaColorCoordinates.Center.Min,areaColorCoordinates.Center.Max)+random.Next(-3,1)):
                              (sbyte)areaColorCoordinates.Center.MinCoastTextureZ,
                              RandomFromList(areaColorCoordinates.Center.Coasts.Coast.LineSouth.List, random),
                              RandomFromList(areaColorCoordinates.Center.Coasts.Ground.LineSouth.List, random), areaColorCoordinates.Center.CliffCoast, true, hue))
            {

                if (!DebugCoast && !areaColorCoordinates.Center.CliffCoast)
                    NorthSmooth(coordinates, _X, _Y, _stride, _bitmapAreaColor, _mapObjects, random);

                if(DebugCoast)
                    mapObjectCoordinates.Center.Altitude = 55;
                return;
            }

            #endregion //NS

            #endregion //Lines


            #region Edges

            #region North East Edge

            if (PlaceObjectNorthEastEdge(
               areaColorCoordinates,
               mapObjectCoordinates,
               coordinates,
               areaColorCoordinates.Center.Type,
               (sbyte)areaColorCoordinates.Center.CoastAltitude,
               (sbyte)areaColorCoordinates.Center.MinCoastTextureZ,
                RandomFromList(areaColorCoordinates.Center.Coasts.Coast.BorderNorthEast.List, random),
               random,
               RandomFromList(areaColorCoordinates.Center.Coasts.Ground.BorderNorthEast.List, random), areaColorCoordinates.Center.CliffCoast, true, hue))
            {
                if(!DebugCoast && !areaColorCoordinates.Center.CliffCoast)
                    SouthWestSmooth(coordinates, _X, _Y, _stride, _bitmapAreaColor, _mapObjects, random);
                
                // precedentemente c'era una linea nord?
                
                if (DebugCoast)
                    mapObjectCoordinates.Center.Altitude = 20;
                //OK
                return;
            }

            #endregion //North East Edge

            #region South West Edge

            if (PlaceObjectSouthWestEdge(areaColorCoordinates,
                               mapObjectCoordinates,
                               coordinates,
                               areaColorCoordinates.Center.Type,
                                (sbyte)areaColorCoordinates.Center.CoastAltitude,
                                (sbyte)areaColorCoordinates.Center.MinCoastTextureZ,
                               //-5,
                               RandomFromList(areaColorCoordinates.Center.Coasts.Coast.BorderSouthWest.List, random),
                               random,
                               RandomFromList(areaColorCoordinates.Center.Coasts.Ground.BorderSouthWest.List, random), areaColorCoordinates.Center.CliffCoast, true, hue))
            {
                if (!DebugCoast && !areaColorCoordinates.Center.CliffCoast)
                    NorthEastSmooth(coordinates, _X, _Y, _stride, _bitmapAreaColor, _mapObjects, random);
                if(DebugCoast)
                    mapObjectCoordinates.Center.Altitude = 5;
                return;
            }

            #endregion // South West Edge

            #region North West Edge

            if (PlaceObjectNorthWestEdge
                (areaColorCoordinates
                 , mapObjectCoordinates,
                 coordinates,
                 areaColorCoordinates.Center.Type,
                (sbyte)areaColorCoordinates.Center.CoastAltitude,
                (sbyte)areaColorCoordinates.Center.MinCoastTextureZ,
                 RandomFromList(areaColorCoordinates.Center.Coasts.Coast.BorderNorthWest.List, random),
                 RandomFromList(areaColorCoordinates.Center.Coasts.Ground.BorderNorthWest.List, random), areaColorCoordinates.Center.CliffCoast, true, hue))
            {
                if (!DebugCoast &&  !areaColorCoordinates.Center.CliffCoast)
                    SouthEastSmooth(coordinates, _X, _Y, _stride, _bitmapAreaColor, _mapObjects, random);

                if (!DebugCoast && areaColorCoordinates.Center.CliffCoast)
                    mapObjectCoordinates.SouthEast.Altitude =
                        (sbyte)
                        (random.Next(areaColorCoordinates.SouthEast.Min, areaColorCoordinates.SouthEast.Max) +
                         random.Next(-4, -2));
                
                if(DebugCoast)
                    mapObjectCoordinates.Center.Altitude = 10;
                return;
            }

            #endregion //North West Edge

            #region South East Edge

            if (PlaceObjectSouthEastEdge(areaColorCoordinates,
                               mapObjectCoordinates,
                               coordinates,
                               areaColorCoordinates.Center.Type,
                                (sbyte)areaColorCoordinates.Center.CoastAltitude,
                                areaColorCoordinates.Center.CliffCoast ? (sbyte)(random.Next(areaColorCoordinates.Center.Min, areaColorCoordinates.Center.Max) + random.Next(-3, 1)) : 
                                (sbyte)areaColorCoordinates.Center.MinCoastTextureZ,
                               RandomFromList(areaColorCoordinates.Center.Coasts.Coast.BorderSouthEast.List, random),
                               //-1,
                               RandomFromList(areaColorCoordinates.Center.Coasts.Ground.BorderSouthEast.List, random), areaColorCoordinates.Center.CliffCoast, true, hue))
            {
                if (!DebugCoast && !areaColorCoordinates.Center.CliffCoast)
                    NorthWestSmooth(coordinates, _X, _Y, _stride, _bitmapAreaColor, _mapObjects, random);
                if (DebugCoast)
                    mapObjectCoordinates.Center.Altitude = 15;
                return;
                
            }

            #endregion //South East Edge

            #endregion //Edges


            var coasts = areaColorCoordinates.List.FirstOrDefault(o => o.Type == TypeColor.WaterCoast);

            _bitmapAreaColor[coordinates.Center] = coasts;
            areaColorCoordinates = new AreaColorCoordinates(coordinates,_bitmapAreaColor);
            MakeCoastUolStyle(areaColorCoordinates, mapObjectCoordinates, coordinates, random);

            #endregion //casual
        }
Exemple #3
0
 private static bool PlaceObjectNorthWestEdge(
     AreaColorCoordinates areaColorCoordinates,
     MapObjectCoordinates mapObjectCoordinates,
     Coordinates coordinates,
     TypeColor type,
     sbyte zItem,
     sbyte altitude,
     int itemid,
     int texture = -1,
     bool ground = false,
     bool occupied = true,
     int hue = 0
     )
 {
     return areaColorCoordinates.IsNorthWestEdge(type) && 
         mapObjectCoordinates.PlaceObjectOcc( areaColorCoordinates, altitude, itemid, zItem, texture, ground,occupied,hue);
 }