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