Пример #1
0
        private void TestBlank()
        {
            bool  equals       = true;
            bool  alldifferent = true;
            Blank template     = null;

            foreach (Blank b in blist)
            {
                if (b._blank != BlankType.FeralCat)
                {
                    template = b;
                    break;
                }
            }
            if (template == null)
            {
                template = blist[0];
            }
            // Equils ?
            foreach (Blank b in blist)
            {
                if (b._blank != BlankType.FeralCat && b._blank != template._blank)
                {
                    equals = false;
                }
            }
            _test_blank = BlankResults.None;
            switch (blist.Count)
            {
            case 2:
                if (equals)
                {
                    _test_blank = BlankResults.Double;
                }
                break;

            case 3:
                if (equals)
                {
                    _test_blank = BlankResults.Triple;
                }
                break;

            case 5:
            {
                for (int i = 0; i < 5; i++)
                {
                    if (blist[i]._blank == BlankType.FeralCat)
                    {
                        continue;
                    }
                    for (int j = 0; j < 5; j++)
                    {
                        if (j == i || blist[j]._blank == BlankType.FeralCat)
                        {
                            continue;
                        }
                        if (blist[i]._blank == blist[j]._blank)
                        {
                            alldifferent = false;
                        }
                    }
                }
                if (alldifferent)
                {
                    _test_blank = BlankResults.FiveCards;
                }
            }
            break;
            }
        }
Пример #2
0
        private void PrepareDeck()
        {
            #region InnerMethods
            void PrepareStandartDeck()
            {
                _exkittens = new ExKitten[_player_count - 1];
                for (byte i = 0; i < _exkittens.Length; i++)
                {
                    _exkittens[i] = new ExKitten(i);
                }
                _defuses = new Defuse[(_player_count == 2) ? 2 : _player_count == 3 ? 3 : 4];
                for (byte i = 0; i < _defuses.Length; i++)
                {
                    _defuses[i] = new Defuse(i);
                }
                _attaks = new Attack[4];
                for (byte i = 0; i < _attaks.Length; i++)
                {
                    _attaks[i] = new Attack(i);
                }
                _seefeutures = new SeeTheFeuture[5];
                for (byte i = 0; i < _seefeutures.Length; i++)
                {
                    _seefeutures[i] = new SeeTheFeuture(i);
                }
                _nopes = new Nope[4];
                for (byte i = 0; i < _nopes.Length; i++)
                {
                    _nopes[i] = new Nope(i);
                }
                _blanks = new Blank[20];
                for (byte i = 0; i < 4; i++)
                {
                    _blanks[i] = new Blank(BlankType.CatMellon, i);
                }
                for (byte i = 4; i < 8; i++)
                {
                    _blanks[i] = new Blank(BlankType.HeirCat, i);
                }
                for (byte i = 8; i < 12; i++)
                {
                    _blanks[i] = new Blank(BlankType.PotatoCat, i);
                }
                for (byte i = 12; i < 16; i++)
                {
                    _blanks[i] = new Blank(BlankType.RainbowBlu, i);
                }
                for (byte i = 16; i < 20; i++)
                {
                    _blanks[i] = new Blank(BlankType.TakkoCat, i);
                }
                _skips = new Skip[4];
                for (byte i = 0; i < _skips.Length; i++)
                {
                    _skips[i] = new Skip(i);
                }
                _shufles = new Shufle[4];
                for (byte i = 0; i < _shufles.Length; i++)
                {
                    _shufles[i] = new Shufle(i);
                }
                _favors = new Favor[4];
                for (byte i = 0; i < _favors.Length; i++)
                {
                    _favors[i] = new Favor(i);
                }
            }

            void PrepareImploadingDeck()
            {
                if (_player_count > 2)
                {
                    ExKitten[] newexkittens = new ExKitten[_exkittens.Length - 1];
                    Array.Copy(_exkittens, newexkittens, _exkittens.Length - 1);
                    _exkittens = newexkittens;
                }
                Blank[] newblanks = new Blank[_blanks.Length + 4];
                Array.Copy(_blanks, newblanks, _blanks.Length);
                _blanks = newblanks;
                for (byte i = 0; i < 4; i++)
                {
                    _blanks[_blanks.Length - 1 - i] = new Blank(BlankType.FeralCat, i);
                }
                _targetattaks = new TargetAttack[3];
                for (byte i = 0; i < 3; i++)
                {
                    _targetattaks[i] = new TargetAttack(i);
                }
                _alterfutures = new AlterTheFeauture[4];
                for (byte i = 0; i < 4; i++)
                {
                    _alterfutures[i] = new AlterTheFeauture(i);
                }
                _drawfrombottoms = new DrawFromTheBottom[4];
                for (byte i = 0; i < 4; i++)
                {
                    _drawfrombottoms[i] = new DrawFromTheBottom(i);
                }
                _reverses = new Reverse[4];
                for (byte i = 0; i < 4; i++)
                {
                    _reverses[i] = new Reverse(i);
                }
            }

            void CreateStandartDeck()
            {
                foreach (Card c in _nopes)
                {
                    _cards.Push(c);
                }
                foreach (Card c in _attaks)
                {
                    _cards.Push(c);
                }
                foreach (Card c in _skips)
                {
                    _cards.Push(c);
                }
                foreach (Card c in _seefeutures)
                {
                    _cards.Push(c);
                }
                foreach (Card c in _blanks)
                {
                    _cards.Push(c);
                }
                foreach (Card c in _shufles)
                {
                    _cards.Push(c);
                }
                foreach (Card c in _favors)
                {
                    _cards.Push(c);
                }
            }

            void CreateImploadingDeck()
            {
                CreateStandartDeck();
                foreach (Card c in _targetattaks)
                {
                    _cards.Push(c);
                }
                foreach (Card c in _alterfutures)
                {
                    _cards.Push(c);
                }
                foreach (Card c in _reverses)
                {
                    _cards.Push(c);
                }
                foreach (Card c in _drawfrombottoms)
                {
                    _cards.Push(c);
                }
            }

            #endregion
            switch (_dt)
            {
            case DeckType.Standart:
            {
                PrepareStandartDeck();
                CreateStandartDeck();
            }
            break;

            case DeckType.Impladings:
            {
                PrepareStandartDeck();
                PrepareImploadingDeck();
                CreateImploadingDeck();
            }
            break;

            case DeckType.Party:
            {
            }
            break;
            }
        }