예제 #1
0
        SpaceAllocation enc.IEncodable <SpaceAllocation> .Decode(enc.IDecoder decoder)
        {
            switch (decoder.GetUnionName())
            {
            case "individual":
                var individual = new IndividualSpaceAllocation();
                return(new Individual(((enc.IEncodable <IndividualSpaceAllocation>)individual).Decode(decoder)));

            case "team":
                var team = new TeamSpaceAllocation();
                return(new Team(((enc.IEncodable <TeamSpaceAllocation>)team).Decode(decoder)));

            default:
                return(Other.Instance);
            }
        }
예제 #2
0
 /// <summary>
 /// <para>Initializes a new instance of the <see cref="Individual" /> class.</para>
 /// </summary>
 /// <param name="value">The value</param>
 public Individual(IndividualSpaceAllocation value)
 {
     this.Value = value;
 }