void BeginRound() { // Get a list of the players in game (Excluding the dealer) List <GameObject> Players = GameManager.Instance.GetPlayersInGame(); int playerCount = 0; // Loop through each player (validate the player) and add 2 cards to their hand foreach (var p in Players) { if (p != null) { if (playerCount != PlayerNum) { PlayerCardController controller = p.GetComponent <PlayerCardController>(); DealCard(controller); DealCard(controller); } else { // Deal 2 Cards to the dealer. DealCard(PlayerCards, false); DealCard(PlayerCards); } playerCount++; } } // Check if any players have a natural CheckNaturals(); }
private void onPlayerCardLoaded(string path, GameObject playerCardPrefab) { Object.Destroy(modalBackground); if (!handle.IsNull) { PlayerCardController component = Object.Instantiate(playerCardPrefab).GetComponent <PlayerCardController>(); component.SetUpPlayerCard(handle); Service.Get <EventDispatcher>().DispatchEvent(new PopupEvents.ShowTopPopup(component.gameObject, destroyPopupOnBackPressed: false, scaleToFit: true, "Accessibility.Popup.Title.PlayerCard")); } }
public void DoubleDown() { if (CheckIfTurn()) { PlayerCardController player = GetPlayerCards(); if (player != null) { player.DoubleDown(); } } }
private void LogBIJoinIgloo() { string tier = "player"; if (!isLocalPlayer) { PlayerCardController componentInParent = GetComponentInParent <PlayerCardController>(); if (componentInParent != null) { FriendStatus friendStatus = componentInParent.FriendStatus; tier = ((friendStatus != FriendStatus.Friend) ? "other" : "friend"); } } Service.Get <ICPSwrveService>().Action("igloo", "visit", tier, "playercard"); }
public void Awake() { // Create an instance if (Instance == null) { Instance = this; } else { Destroy(this.gameObject); } // Get required components PlayerCards = GetComponent <PlayerCardController>(); Brain = GetComponent <AI_Brain>(); }
void Awake() { // Gets the required components CardController = GetComponent <PlayerCardController>(); }
/// <summary> /// This method will deal a card to the player /// </summary> /// <param name="Cards">Card Controller</param> /// <param name="ShowCard">Whether to show the card or not</param> public void DealCard(PlayerCardController Cards, bool ShowCard = true) { Cards.AddCard(GetCard(), ShowCard); }