Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public static void Encode(XdrDataOutputStream stream, InflationResultCode value)
 {
     stream.WriteInt((int)value.InnerValue);
 }