public int resolveTrick() { RawCard winCard; if (playedCards.Exists(x => x.Number == 15)) { winCard = playedCards.Find(x => x.Number == 15); } else if (playedCards.Exists(x => x.Suit == trump.Suit && x.Number != 1)) { playedCards.Sort(); winCard = playedCards.FindLast(x => x.Suit == trump.Suit); } else if (playedCards.TrueForAll(x => x.Number == 1)) { winCard = playedCards[0]; } else { ESuit lead = playedCards.Find(x => x.Number != 1).Suit; playedCards.Sort(); winCard = playedCards.FindLast(x => x.Suit == lead); } int winPlayer = cardMap[winCard]; return(winPlayer); }
public Card(EValue value, ESuit suit) { Suit = suit; Value = value; Name = $"{value} of {Suit}"; }
//カードの設定 public void Set(CardData data) { //カード情報を設定 this.mData = data; //IDを設定する this.Id = data.Id; // スートを設定する this.Suit = data.Suit; //表示する画像を設定する //初回はすべて裏面表示とする this.CardImage.sprite = Resources.Load <Sprite>("Image/TrumpBack"); //選択判定フラグを初期化する this.mIsSelected = false; // アルファ値を1に設定 this.CanGroup.alpha = 1; if (this.CanGroup.alpha == 1) { //Debug.Log("alpha=1!"); } // 座標情報を取得しておく this.mRt = this.GetComponent <RectTransform> (); }
public CardData(ECard _ID) { ID = _ID; if (ID == ECard.None) { Suit = ESuit.None; } else { Suit = CardManager.m_kCardSuits[ID - 1]; } }
public void Deserialize(System.IO.Stream inputStream) { byte[] _intSuit = new byte[sizeof(int)]; inputStream.Read(_intSuit, 0, sizeof(int)); intSuit = BitConverter.ToInt32(_intSuit, 0); suit = (ESuit)intSuit; byte[] _number = new byte[sizeof(int)]; inputStream.Read(_number, 0, sizeof(int)); number = BitConverter.ToInt32(_number, 0); byte[] _playerID = new byte[sizeof(int)]; inputStream.Read(_playerID, 0, sizeof(int)); playerID = BitConverter.ToInt32(_playerID, 0); }
/// <summary> /// Может ли вторая карта стать парой для первой /// </summary> /// <param name="enMainSuit">козырная масть</param> /// <param name="pCard2">отбивающая карта</param> /// <returns></returns> public bool Response(ESuit enMainSuit, Card pCard2) { if (pCard2.Suit == Card1.Suit) { if (pCard2.Value > Card1.Value) { Card2 = pCard2; return(true); } } else { if (pCard2.Suit == enMainSuit) { Card2 = pCard2; return(true); } } return(false); }
public Card(ESuit newSuit, ECardValue newCardValue) { m_eSuit = newSuit; m_eCardValue = newCardValue; }
public Card(ESuit mSuit, EValue mValue) { Suit = mSuit; Value = mValue; Initialize(); }
public RawCard(ESuit suit, int number, int playerID) { this.suit = suit; this.number = number; this.playerID = playerID; }
public RawCard(ESuit suit, int number) { this.suit = suit; this.number = number; }
public PlayingCard(int value, ESuit suit) : base(suit.ToString() + value, 1, 51, null, null) { }
public static Color getSuitColourDark(ESuit suit) { return(suitArrayDark[(int)suit]); }
public Card(ESuit enSuit, EValue enValue) { Suit = enSuit; Value = enValue; }
public Rectangle getTexRect(ESuit suit, int number) { return(rectangleMapArray [(int)suit] [number]); }
public CardInfo(int _id, ESuit _suit) { this.Id = _id; this.Suit = _suit; }
public CardData(int _id, ESuit _suit, Sprite _sprite) { this.Id = _id; this.Suit = _suit; this.ImgSprite = _sprite; }