Example #1
0
 int main()
  {
  	printf("Testing outpost\n");
    int i;
    int seed = 1000;
    int numPlayer = 2;
    int p, r;
    int handPos = 0;
    int k[10] = {adventurer, council_room, feast, gardens, mine
               , remodel, smithy, village, baron, great_hall};
    struct gameState G;

    int handCount, prevPlayed;


    memset(&G, 23, sizeof(struct gameState));
    r = initializeGame(numPlayer, k, seed, &G);
    p = G.whoseTurn;
    G.hand[p][0] = outpost;
    G.hand[p][1] = outpost;
    G.hand[p][2] = outpost;
    G.hand[p][3] = outpost;
    G.hand[p][4] = outpost;
    prevPlayed = G.outpostPlayed;
    playOutpost(p, handPos, &G);
    i=0;
    if(G.outpostPlayed != prevPlayed + 1)
    {
    	printf("Test Failed: Outpost Flag not set\n");
    	i++;
    }
    if(i==0)
    {
    	printf("All tests passed\n");
    }



 	return 0;
 }
Example #2
0
int cardEffect(int card, int choice1, int choice2, int choice3, struct gameState *state, int handPos, int *bonus)
{
   //uses switch to select card and perform actions
  switch( card ) 
    {
    case adventurer:
       return (playAdventurer(state));
	
    case council_room:
       return (playCouncil_Room(state, handPos));
			
    case feast:
       return(playFeast(state, choice1)); 
	
    case gardens:
       return -1;

    case smithy:
      return (playSmithy(state, handPos));
		
    case village:
      return (playVillage(state, handPos));
			
    case mine:
      return(playMine(state, choice1, choice2, handPos));
			
    case remodel:
      return(playRemodel(state, choice1, choice2, handPos));
 
    case baron:
      return(playBaron(state, choice1, choice2, handPos));
   
    case great_hall:
      return(playGreat_hall(state, handPos));
 
    case minion:
      return(playMinion(state, choice1, choice2, handPos));

    case steward:
      return(playSteward(state, choice1, choice2, choice3, handPos));
		
    case tribute:
      return(playTribute(state));

    case ambassador:
      return(playAmbassador(state,choice1, choice2, handPos));
		
    case cutpurse:
      return(playCutpurse(state, handPos));
		
    case embargo:
      return(playEmbargo(state, choice1, handPos));
		
    case outpost:
      return(playOutpost(state, handPos));
		
    case salvager:
      return(playSalvager(state, choice1, handPos));
		
    case sea_hag:
      return(playSea_hag(state));
		
    case treasure_map:
      return(playTreasure_map(state, handPos));
 
    }
  return -1;
}