public static BountyAllocator GetRepresentativeSelector(IBountyAllocationMethod bountyAllocationMethod) { if (bountyAllocationMethod.Version == BountyAllocationMethodTypes.Instance.EqualSplit) { if (bountyAllocationMethod.Version == (1, 0)) { return(new EqualSplitBountyAllocator(bountyAllocationMethod)); } } throw new ApplicationException("Invalid bounty allocation type"); }
public static IBountyAllocationMethod Rehydrate(IDataRehydrator rehydrator) { var version = rehydrator.RehydrateRewind <ComponentVersion <BountyAllocationMethodType> >(); IBountyAllocationMethod bountyAllocationMethod = null; if (version.Type == BountyAllocationMethodTypes.Instance.EqualSplit) { if (version == (1, 0)) { bountyAllocationMethod = new EqualSplitBountyAllocationMethod(); } } if (bountyAllocationMethod == null) { throw new ApplicationException("Invalid candidacy selector type"); } bountyAllocationMethod.Rehydrate(rehydrator); return(bountyAllocationMethod); }
public const decimal NO_SHARE_PEER_ALLOCATION = 0.33M; // 33% public EqualSplitBountyAllocator(IBountyAllocationMethod BountyAllocationMethod) : base(BountyAllocationMethod) { }
public BountyAllocator(IBountyAllocationMethod BountyAllocationMethod) { this.BountyAllocationMethod = BountyAllocationMethod; }