示例#1
0
        /// <summary>
        /// Создаем новую стену, в соответствии с тем что указал пользователь
        /// </summary>
        public Map.Wall NewWall(Point location, bool fake = false)
        {
            byte material = GetSelWallTypeIndex();

            Map.Wall.WallFacing facing = (Map.Wall.WallFacing)wallFacing;

            Map.Wall wall = new Map.Wall(location, facing, material, (byte)MinimapGroup, (byte)numWallVari.Value);

            //wall.Destructable = checkBreakableWall.Checked;
            wall.Window = wallWindowed;

            // generate random variation
            if (autovari.Checked && !fake && !started)
            {
                if (wall.Window)
                {
                    return(wall);
                }
                if ((int)wall.Facing > 1)
                {
                    return(wall);
                }

                Random rnd     = new Random(location.Y + location.Y + (int)DateTime.Now.Ticks);
                int    randvar = rnd.Next((int)numWallVari.Value, (int)numWallVariMax.Value + 1);
                byte   rndvari = Convert.ToByte(randvar);

                wall.Variation = (byte)rnd.Next((int)numWallVari.Value, (int)numWallVariMax.Value + 1);
                if (wall.Window)
                {
                    wall.Variation = 0;
                }

                if ((int)wall.Facing == 2)
                {
                    wall.Variation = 0;
                }
            }
            started = false;

            return(wall);
        }
示例#2
0
 private void wallFacingButton_Click(object sender, EventArgs e)
 {
     facing = (Map.Wall.WallFacing)wallFacingButtons.IndexOf(sender);
     Mapview.CurrentMode = MapView.Mode.MAKE_WALL;
 }