private void OnTileEdit(object sender, GetDataHandlers.TileEditEventArgs args)
        {
            if (players[args.Player.Index])
            {
                switch (args.EditType)
                {
                case 0:
                case 4:
                {
                    Recursive      re  = new Recursive();
                    List <Vector2> del = re.RecursiveEdit(args.X, args.Y, args.EditType);
                    foreach (Vector2 tip in del)
                    {
                        WorldGen.KillTile(Convert.ToInt16(tip.X), Convert.ToInt16(tip.Y));
                        TSPlayer.All.SendTileSquare(Convert.ToInt16(tip.X), Convert.ToInt16(tip.Y), 1);
                    }
                    break;
                }

                case 2:
                {
                    Recursive      re  = new Recursive();
                    List <Vector2> del = re.RecursiveEdit(args.X, args.Y, args.EditType);
                    foreach (Vector2 tip in del)
                    {
                        WorldGen.KillWall(Convert.ToInt16(tip.X), Convert.ToInt16(tip.Y));
                        TSPlayer.All.SendTileSquare(Convert.ToInt16(tip.X), Convert.ToInt16(tip.Y), 1);
                    }
                    break;
                }

                case 6:
                {
                    Recursive      re  = new Recursive();
                    List <Vector2> del = re.RecursiveEdit(args.X, args.Y, args.EditType);
                    foreach (Vector2 tip in del)
                    {
                        WorldGen.KillWire(Convert.ToInt16(tip.X), Convert.ToInt16(tip.Y));
                        TSPlayer.All.SendTileSquare(Convert.ToInt16(tip.X), Convert.ToInt16(tip.Y), 1);
                    }
                    break;
                }
                }
            }
        }
Beispiel #2
0
 private void OnTileEdit( object sender, GetDataHandlers.TileEditEventArgs args )
 {
     if (players[args.Player.Index])
     {
         switch (args.EditType)
         {
             case 0:
             case 4:
                 {
                     Recursive re = new Recursive();
                     List<Vector2> del = re.RecursiveEdit(args.X, args.Y, args.EditType);
                     foreach (Vector2 tip in del)
                     {
                         WorldGen.KillTile(Convert.ToInt16(tip.X), Convert.ToInt16(tip.Y));
                         TSPlayer.All.SendTileSquare(Convert.ToInt16(tip.X), Convert.ToInt16(tip.Y), 1);
                     }
                     break;
                 }
             case 2:
                 {
                     Recursive re = new Recursive();
                     List<Vector2> del = re.RecursiveEdit(args.X, args.Y, args.EditType);
                     foreach (Vector2 tip in del)
                     {
                         WorldGen.KillWall(Convert.ToInt16(tip.X), Convert.ToInt16(tip.Y));
                         TSPlayer.All.SendTileSquare(Convert.ToInt16(tip.X), Convert.ToInt16(tip.Y), 1);
                     }
                     break;
                 }
             case 6:
                 {
                     Recursive re = new Recursive();
                     List<Vector2> del = re.RecursiveEdit(args.X, args.Y, args.EditType);
                     foreach (Vector2 tip in del)
                     {
                         WorldGen.KillWire(Convert.ToInt16(tip.X), Convert.ToInt16(tip.Y));
                         TSPlayer.All.SendTileSquare(Convert.ToInt16(tip.X), Convert.ToInt16(tip.Y), 1);
                     }
                     break;
                 }
         }
     }
 }