public HandDatabase() { //Stateless hands IPieceStacksProvider[] pieceStacksProviders = new IPieceStacksProvider[NumberOfPieceStacksProviders] { new TheUnbeatable(), new TheSocialOrder(), new TheCulture(), new TheAttack(), new TheKing(), new TheAnimals(), new TheDeadlyArmy(), new TheCavalry(), new TheArmy(), new TheComrades() }; int[] baseScores = new int[NumberOfPieceStacksProviders] { 50, 10, 7, 5, 3, 3, 3, 5, 3, 3 }; int bounus = 2; this.hands = new IHand[NumberOfPieceStacksProviders * 2 + 2]; this.overwriteHandPairs = new OverwriteHandPair[NumberOfPieceStacksProviders]; for (int i = 0; i < NumberOfPieceStacksProviders; i++) { hands[i * 2] = new DefaultHand(pieceStacksProviders[i], baseScores[i]); hands[i * 2 + 1] = new FlashHand(pieceStacksProviders[i], baseScores[i] + bounus); overwriteHandPairs[i] = new OverwriteHandPair(hands[i * 2], hands[i * 2 + 1]); } }
internal HandSuccessChecker(IPieceStacksProvider pieceStacksProvider) { pieceStacks = pieceStacksProvider.GetPieceStacks(); }
internal DefaultHand(IPieceStacksProvider pieceStacksProvider, int score) { handSuccessChecker = new HandSuccessChecker(pieceStacksProvider); Name = pieceStacksProvider.HandName; Score = score; }
internal FlashHand(IPieceStacksProvider pieceStacksProvider, int score) { handSuccessChecker = new HandSuccessChecker(pieceStacksProvider); Name = ToFlash(pieceStacksProvider.HandName); Score = score; }