Пример #1
0
        public bool ValidatePlay(Card DownCard, Card Played, Player played)
        {
            AttributeValue[] Entry = new AttributeValue[5];
            Entry[0] = new IntegerValue(DownCard.Number);
            Entry[1] = new IntegerValue(DownCard.Suit);
            Entry[2] = new IntegerValue(Played.Number);
            Entry[3] = new IntegerValue(Played.Suit);
            Entry[4] = new BooleanValue(false);

            if (_Forest == null) return true;
            else return Convert.ToBoolean(_Forest.MakeDecision(Entry).ToString());
        }
Пример #2
0
        static AttributeValue[] GenerateEntry()
        {
            int DownNumber = Random.Next(1, 14);
            int DownSuit = Random.Next(1, 5);
            AttributeValue[] E = new AttributeValue[5];
            E[0] = new IntegerValue(DownNumber);
            E[1] = new IntegerValue(DownSuit);
            int CardNumber = Random.Next(1, 14);
            int CardSuit = Random.Next(1, 5);
            E[2] = new IntegerValue(CardNumber);
            E[3] = new IntegerValue(CardSuit);
            E[4] = new BooleanValue(ValidPlay(DownNumber, DownSuit, CardNumber, CardSuit));

            return E;
        }
Пример #3
0
        static AttributeValue[] GenerateEntry()
        {
            int DownNumber = Random.Next(1, 14);
            int DownSuit   = Random.Next(1, 5);

            AttributeValue[] E = new AttributeValue[5];
            E[0] = new IntegerValue(DownNumber);
            E[1] = new IntegerValue(DownSuit);
            int CardNumber = Random.Next(1, 14);
            int CardSuit   = Random.Next(1, 5);

            E[2] = new IntegerValue(CardNumber);
            E[3] = new IntegerValue(CardSuit);
            E[4] = new BooleanValue(ValidPlay(DownNumber, DownSuit, CardNumber, CardSuit));

            return(E);
        }
Пример #4
0
        public void VerifyPlay(Card DownCard, Card Played, bool Valid)
        {
            AttributeValue[] Entry = new AttributeValue[5];
            Entry[0] = new IntegerValue(DownCard.Number);
            Entry[1] = new IntegerValue(DownCard.Suit);
            Entry[2] = new IntegerValue(Played.Number);
            Entry[3] = new IntegerValue(Played.Suit);
            Entry[4] = new BooleanValue(Valid);

            if (_Forest == null) _Forest = new Forest(1, 1, delegate(int i) { DataSet D = new DataSet(5); D.AddEntry(Entry); return D; }, 4);
            else _Forest.AddEntry(Entry);
        }