您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ stewardEffect函数代码示例

51自学网 2021-06-03 08:23:41
  C++
这篇教程C++ stewardEffect函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中stewardEffect函数的典型用法代码示例。如果您正苦于以下问题:C++ stewardEffect函数的具体用法?C++ stewardEffect怎么用?C++ stewardEffect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了stewardEffect函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: cardEffect

//.........这里部分代码省略.........        case smithy:                return smithyEffect(state, handPos);        case village:                //+1 Card                drawCard(currentPlayer, state);                //+2 Actions                state->numActions = state->numActions + 2;                //discard played card from hand                discardCard(handPos, currentPlayer, state, 0);                return 0;        case baron:                return baronEffect(state, choice1);        case great_hall:                //+1 Card                drawCard(currentPlayer, state);                //+1 Actions                state->numActions++;                //discard card from hand                discardCard(handPos, currentPlayer, state, 0);                return 0;        case minion:                return minionEffect(state, handPos, choice1, choice2);        case steward:                return stewardEffect(state, handPos, choice1, choice2, choice3);        case tribute:                if ((state->discardCount[nextPlayer] + state->deckCount[nextPlayer]) <= 1) {                        if (state->deckCount[nextPlayer] > 0) {                                tributeRevealedCards[0] = state->deck[nextPlayer][state->deckCount[nextPlayer]-1];                                state->deckCount[nextPlayer]--;                        }                        else if (state->discardCount[nextPlayer] > 0) {                                tributeRevealedCards[0] = state->discard[nextPlayer][state->discardCount[nextPlayer]-1];                                state->discardCount[nextPlayer]--;                        }                        else{                                //No Card to Reveal                                if (DEBUG) {                                        printf("No cards to reveal/n");                                }                        }                }                else{                        if (state->deckCount[nextPlayer] == 0) {                                for (i = 0; i < state->discardCount[nextPlayer]; i++) {                                        state->deck[nextPlayer][i] = state->discard[nextPlayer][i];//Move to deck                                        state->deckCount[nextPlayer]++;                                        state->discard[nextPlayer][i] = -1;                                        state->discardCount[nextPlayer]--;                                }                                shuffle(nextPlayer,state);//Shuffle the deck                        }                        tributeRevealedCards[0] = state->deck[nextPlayer][state->deckCount[nextPlayer]-1];                        state->deck[nextPlayer][state->deckCount[nextPlayer]--] = -1;
开发者ID:TheTallPaul,项目名称:cs362sp16_melloc,代码行数:67,


示例2: cardEffect

//.........这里部分代码省略.........					  //draw 4	  for (i = 0; i < 4; i++)	    {	      drawCard(currentPlayer, state);	    }					  //other players discard hand and redraw if hand size > 4	  for (i = 0; i < state->numPlayers; i++)	    {	      if (i != currentPlayer)		{		  if ( state->handCount[i] > 4 )		    {		      //discard hand		      while( state->handCount[i] > 0 )			{			  discardCard(handPos, i, state, 0);			}									      //draw 4		      for (j = 0; j < 4; j++)			{			  drawCard(i, state);			}		    }		}	    }					}      return 0;		    case steward:		return stewardEffect(choice1, choice2, choice3, currentPlayer, handPos, state);		    case tribute:      if ((state->discardCount[nextPlayer] + state->deckCount[nextPlayer]) <= 1){	if (state->deckCount[nextPlayer] > 0){	  tributeRevealedCards[0] = state->deck[nextPlayer][state->deckCount[nextPlayer]-1];	  state->deckCount[nextPlayer]--;	}	else if (state->discardCount[nextPlayer] > 0){	  tributeRevealedCards[0] = state->discard[nextPlayer][state->discardCount[nextPlayer]-1];	  state->discardCount[nextPlayer]--;	}	else{	  //No Card to Reveal	  if (DEBUG){	    printf("No cards to reveal/n");	  }	}      }	          else{	if (state->deckCount[nextPlayer] == 0){	  for (i = 0; i < state->discardCount[nextPlayer]; i++){	    state->deck[nextPlayer][i] = state->discard[nextPlayer][i];//Move to deck	    state->deckCount[nextPlayer]++;	    state->discard[nextPlayer][i] = -1;	    state->discardCount[nextPlayer]--;	  }			    	  shuffle(nextPlayer,state);//Shuffle the deck	} 	tributeRevealedCards[0] = state->deck[nextPlayer][state->deckCount[nextPlayer]-1];	state->deck[nextPlayer][state->deckCount[nextPlayer]--] = -1;
开发者ID:quinnsam,项目名称:Oregon_State_Classes,代码行数:67,



注:本文中的stewardEffect函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ stgMallocBytes函数代码示例
C++ stereotype函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。