public static InflationResult Decode(XdrDataInputStream stream) { InflationResult decodedInflationResult = new InflationResult(); InflationResultCode discriminant = InflationResultCode.Decode(stream); decodedInflationResult.Discriminant = discriminant; switch (decodedInflationResult.Discriminant.InnerValue) { case InflationResultCode.InflationResultCodeEnum.INFLATION_SUCCESS: int payoutssize = stream.ReadInt(); decodedInflationResult.Payouts = new InflationPayout[payoutssize]; for (int i = 0; i < payoutssize; i++) { decodedInflationResult.Payouts[i] = InflationPayout.Decode(stream); } break; default: break; } return(decodedInflationResult); }
public static void Encode(XdrDataOutputStream stream, InflationResultCode value) { stream.WriteInt((int)value.InnerValue); }