private void DecodeCheck2(BitArray bt) { var valCheck2 = bt.ReadBits(2); if (valCheck2 == 0) { Value = 0; Left = new Event(0); Right = new Event(); Right.Decode(bt); return; } if (valCheck2 == 1) { SetAsNode(0, null, 0, bt); return; } if (valCheck2 == 2) { SetAsNode(0, null, null, bt); return; } if (valCheck2 == 3) { DecodeCheck3(bt); return; } throw new EventOperationException("Decode Failed (Check2)", this, null); }
public void SetAsNode(int value, int? leftValue, int? rightValue, BitArray bt) { Value = value; if (leftValue.HasValue) { Left = new Event(leftValue.Value); } else { Left = new Event(); Left.Decode(bt); } if (rightValue.HasValue) { Right = new Event(rightValue.Value); } else { Right = new Event(); Right.Decode(bt); } }