Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created June 26, 2018 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todorok1/633b44518ae614904fc7a49069d552fb to your computer and use it in GitHub Desktop.
Save todorok1/633b44518ae614904fc7a49069d552fb to your computer and use it in GitHub Desktop.
山札から何枚かのカードを手札に加えるサンプル
void DistributeFromDeckHead(int numRequired){
// シャッフルされた山札の先頭からカードを配布する
playerCardList = new List<Card>();
for (int i = 0; i < numRequired; i++){
playerCardList.Add(cardList[i]);
}
// プレイヤーに配布したカードをリストから削除
cardList.RemoveRange(0, numRequired);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment