public void MulliganCard(MulliganCard mulliganCard) { // Disable selecting further cards for mulliganing until // we receive a response from the server // TODO: TEST THIS //mulliganRow.BlockRaycasts(true); SerializedMulligan message = new SerializedMulligan( "mulligan", new SerializedCard(mulliganCard.id)); SendString(JsonConvert.SerializeObject(message)); ReceiveMulliganHand().Then(hand => { mulliganRow.Populate(hand.cards.Select(c => c.ToMulliganCard(mulliganRow))); mulliganCountText.Increment(); if (mulliganCountText.Count() == 2) { if (hand.selectWhoGoesFirst) { whoGoesFirstScreen.Show(); } else { WaitForStartGameMessage(); } } else { //mulliganRow.BlockRaycasts(false); } }); }
public MulliganCard ToMulliganCard(MulliganRow mulliganRow) { return(MulliganCard.CreateCard( mulliganRow, id, ParseCombatTypes(this.combatTypes), ParseCardAttributes(this.attributes), basePower, faction)); }
public static MulliganCard CreateCard( MulliganRow mulliganRow, String id, IList <CombatType> combatTypes, IList <CardAttribute> attributes, int?basePower, String faction) { GameObject cardObject = Instantiate((GameObject)Resources.Load("MulliganCard"), mulliganRow.transform); MulliganCard card = cardObject.GetComponent <MulliganCard>(); card.cardObject = cardObject; card.id = id; card.combatTypes = new List <CombatType>(combatTypes); card.attributes = new List <CardAttribute>(attributes); card.basePower = basePower; card.faction = faction; card.image = Resources.Load <Sprite>("CardImages/" + id); return(card); }
public int Compare(MulliganCard c1, MulliganCard c2) { return(Compare((Card)c1, (Card)c2)); }