Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
山札から何枚かのカードを手札に加えるサンプル
void CheckDuplication(List<Card> cards){
// 手札にあるカードが山札に無いことを確認する
System.Text.StringBuilder sb = new System.Text.StringBuilder();
string duplicateText;
string separator = ", ";
for (int i = 0; i < cards.Count; i++){
if (cardList.Exists(x => x.Equals(cards[i]))){
duplicateText = "が重複";
} else {
duplicateText = "は重複せず";
}
if (cards[i].isJoker){
sb.Append("JOKER");
} else {
sb.Append(GetSuitMark(cards[i].suit)).Append(GetSpecialNumber(cards[i].number));
}
sb.Append(duplicateText).Append(separator);
}
string line = sb.ToString();
line = RemoveLastSeparator(line, separator);
Debug.Log(line);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.