예제 #1
0
        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]);
            }
        }
예제 #2
0
 internal HandSuccessChecker(IPieceStacksProvider pieceStacksProvider)
 {
     pieceStacks = pieceStacksProvider.GetPieceStacks();
 }
예제 #3
0
 internal DefaultHand(IPieceStacksProvider pieceStacksProvider, int score)
 {
     handSuccessChecker = new HandSuccessChecker(pieceStacksProvider);
     Name  = pieceStacksProvider.HandName;
     Score = score;
 }
예제 #4
0
 internal FlashHand(IPieceStacksProvider pieceStacksProvider, int score)
 {
     handSuccessChecker = new HandSuccessChecker(pieceStacksProvider);
     Name  = ToFlash(pieceStacksProvider.HandName);
     Score = score;
 }