public HandCategoriserChain() { // configurate categorisers in a chain responsibility Head = new RoyalFlushCategoriser(new RoyalFlushRule()); Head.RegisterNext(new StraightFlushCategoriser(new StraightFlushRule())) .RegisterNext(new FourOfAKindCategoriser(new FourOfAKindRule())) .RegisterNext(new FullHouseCategoriser(new FullHouseRule())) .RegisterNext(new FlushCategoriser(new FlushRule())) .RegisterNext(new StraightCategoriser(new StraightRule())) .RegisterNext(new ThreeOfAKindCategoriser(new ThreeOfAKindRule())) .RegisterNext(new TwoPairsCategoriser(new TwoPairsRule())) .RegisterNext(new PairCategoriser(new PairRule())) .RegisterNext(new HighCardCategoriser(new HighCardRule())); }
/// <summary> /// Allow to register next Hand Categoriser into the categoriser chain. /// </summary> /// <param name="next"></param> /// <returns></returns> public HandCategoriser RegisterNext(HandCategoriser next) { Next = next; return(Next); }