// 0x34: RDUs
 // [XX XX] [YY YY] [ZZ ZZ]
 private void decodeRDUs(byte[] data)
 {
     uint start = BE.U32(data, 0x34);
      uint end = BE.U32(data, 0x38);
      for (uint idx = start; idx < end; idx += 6)
      {
     Int16 x, y, z;
     x = BE.I16(data, idx);
     y = BE.I16(data, idx + 2);
     z = BE.I16(data, idx + 4);
     RDU rdu = new RDU(x, y, z);
     rdus.Add(rdu);
      }
 }
 private void BlastCorpsViewer_MouseUp(object sender, MouseEventArgs e)
 {
     if (level != null && e.Button == System.Windows.Forms.MouseButtons.Left)
      {
     switch (Mode)
     {
        case MouseMode.Move:
           if (dragItem != null)
           {
              selectedItem = dragItem;
              OnSelectionChangedEvent(new SelectionChangedEventArgs(selectedItem, false, false));
              dragItem = null;
              Invalidate();
           }
           break;
        case MouseMode.Add:
           Int16 x = (Int16)levelX(e.X);
           Int16 z = (Int16)levelZ(e.Y);
           if (AddType == typeof(AmmoBox))
           {
              AmmoBox box = new AmmoBox(x, level.carrier.y, z, 0);
              selectedItem = box;
              level.ammoBoxes.Add(box);
           }
           else if (AddType == typeof(CommPoint))
           {
              CommPoint comm = new CommPoint(x, level.carrier.y, z, 0);
              selectedItem = comm;
              level.commPoints.Add(comm);
           }
           else if (AddType == typeof(RDU))
           {
              RDU rdu = new RDU(x, level.carrier.y, z);
              selectedItem = rdu;
              level.rdus.Add(rdu);
           }
           else if (AddType == typeof(TNTCrate))
           {
              TNTCrate tnt = new TNTCrate(x, level.carrier.y, z, 0, 0, 0, 0);
              selectedItem = tnt;
              level.tntCrates.Add(tnt);
           }
           else if (AddType == typeof(SquareBlock))
           {
              SquareBlock block = new SquareBlock(x, level.carrier.y, z, SquareBlock.Type.Block, SquareBlock.Shape.Square);
              selectedItem = block;
              level.squareBlocks.Add(block);
           }
           else if (AddType == typeof(Vehicle))
           {
              Vehicle vehicle = new Vehicle(0, x, level.carrier.y, z, 0);
              selectedItem = vehicle;
              level.vehicles.Add(vehicle);
           }
           else if (AddType == typeof(Building))
           {
              Building building = new Building(x, level.carrier.y, z, 0, 0, 0, 0, 0);
              selectedItem = building;
              level.buildings.Add(building);
           }
           OnSelectionChangedEvent(new SelectionChangedEventArgs(selectedItem, true, false));
           Invalidate();
           break;
     }
      }
 }