//set values //Input: sending player string, activity card to be cooperated on, choice index highlighted by sending player public void Init(string sendingPlayerCompanyName, ActivityCard activityCard, ActivityChoice choice) { companyNameText.text = sendingPlayerCompanyName; coopCardController.SetCardData(activityCard); coopCardController.HighlightChoice(choice); coopCardController.SetPlayerHandController(GameObject.Find("Player").GetComponent <PlayerHandController>()); }
// methods needed to change turndata array, these happen based on what cards the player plays during their turn. For example playing a card which gives them x more money will modify the corresponding // money index in the array by x. // these are probably being written by someone else right now and will be merged later. // public void OnTurnStart() { //Display new turn text StartCoroutine(DisplayNewTurnText()); //commit cards played last turn if (cardsPlayedLastTurn.Count != 0) { foreach (ActivityCard card in cardsPlayedLastTurn.Keys) { //Apply stat changes ActivityChoice choice = card.GetChoice(cardsPlayedLastTurn[card]); for (int j = 0; j < choice.statChanges.Count; j++) { playerStats.AddToStat(choice.statChanges[j]); } //Apply news counter changes newsCounter += choice.addToNewsCounter; //Add any potential priority cards to queue if (choice.HasPriorityCard()) { Debug.Log(deck.priorityCards); deck.AddToQueue(choice.priorityCardToTrigger); } //commit to history try { choiceHistory.Add(card, cardsPlayedLastTurn[card]); } catch (System.ArgumentException) { Debug.Log("Uh oh card already in choiceHistory"); } } //clear cards played last turn cardsPlayedLastTurn.Clear(); } //get stat changes based on features List <StatChange> featureStatChanges = playerFeatures.GetStatChanges(); for (int i = 0; i < featureStatChanges.Count; i++) { playerStats.AddToStat(featureStatChanges[i]); } //update newsfeed playerNewsFeedController.OnTurnStart(); //fill hand FillHand(); localNetworkPlayer.UpdateValues(); }
//Highlight choice matching title of input choice public void HighlightChoice(ActivityChoice choice) { for (int i = 0; i < choiceDropdown.options.Count; i++) { if (choice.title == choiceDropdown.options[i].text) { choiceDropdown.value = i; return; } } Debug.Log("Choice not found in choicedropdown options"); }
public bool ValidateChoice(ActivityChoice choice) { return(choice.ValidateChoice(playerFeatures.GetPurchasedFeatureTitlesAsHashSet(), playerStats.stats)); }
public int GetChoiceIndex(ActivityChoice c) { return(choices.IndexOf(c)); }