private void add_Click(object sender, EventArgs e)
 {
     save = true;
     nhash = (Int16)hashf.Hash(paramName.Text);
     nName = paramName.Text;
     switch (vLength.SelectedIndex)
     {
         case 0:
             vaLength = 2;
             nValue = (Int16)value.Value;
             break;
         case 1:
             vaLength = 4;
             nValue = (Int32)value.Value;
             break;
         case 2:
             vaLength = 4;
             dubVal = (double)value.Value;
             break;
         case 3:
             vaLength = 12;
             vec = new math.vector((double)value.Value, (double)vVal1.Value, (double)vVal2.Value);
             break;
         default:
             break;
     }
     this.Close();
 }
 //constructer, it determines a few things to get length.
 public Parameter(Int16 hsh, byte n, string nme, Int32 vlen, bbreader binr)
 {
     this.hash = hsh;
     this.nb = n;
     this.name = nme;
     this.valueLength = vlen;
     switch (vlen)
     {
         case 4:
             if (!this.name.Contains("Color"))
             {
                 this.flag = valueType.unk;
                 this.fourVal = binr.ReadBytes(4);
                 Array.Reverse(this.fourVal);
                 this.intValue = BitConverter.ToInt32(this.fourVal, 0);
                 this.dubValue = BitConverter.ToSingle(this.fourVal, 0);
                 Array.Reverse(this.fourVal);
             }
             else {
                 flag = valueType.color;
                 this.colorVal = binr.readRgba();
             }
             break;
         case 2:
             flag = valueType.integer;
             this.intValue = binr.ReadInt16();
             break;
         case 1:
             flag = valueType.integer;
             this.intValue = binr.ReadByte();
             break;
         case 12:
             flag = valueType.vec;
             this.vec = new math.vector(binr.ReadSingle(), binr.ReadSingle(), binr.ReadSingle());
             break;
         default:
             Console.Write("Unknown Value Length {0} at offset {1}", this.valueLength, binr.BaseStream.Position);
             break;
     }
 }