public CardArray clone() { List<int> intCards = toIntList(); CardArray cloneObject = new CardArray(); for (int i = 0; i < intCards.Count; i++) { cloneObject.addCard(intCards[i]); } return cloneObject; }
async Task <List <apiCard> > awaitmethod2() { CardArray returnval = new CardArray() { card = null }; HttpResponseMessage response = await api.GetAsync($"v4/cardinfo.php?name={textBox1.Text}"); if (response.IsSuccessStatusCode) { var rsp = await response.Content.ReadAsStringAsync(); rsp = rsp.Substring(1, rsp.Length - 2); List <apiCard> li = JArray.Parse(rsp).ToObject <List <apiCard> >(); return(li); } return(null); }
public static void decode(string jsonInfo) { DeskCardsPromptObject deskCardsPromptObject = ModelManager.shareInstance().getDeskCardsPromptObject(); Dictionary<string, object> data = Json.Deserialize(jsonInfo) as Dictionary<string, object>; List<object> promptCardsList = data["cards"] as List<object>; List<CardArray> promptCards = new List<CardArray>(); for (int i = 0; i < promptCardsList.Count; i++) { List<object> promptCardsPerRound = promptCardsList[i] as List<object>; CardArray cards = new CardArray(); for (int j = 0; j < promptCardsPerRound.Count; j++) { cards.addCard(Convert.ToInt32(promptCardsPerRound[j])); } promptCards.Add(cards); } deskCardsPromptObject.setCards(promptCards); }
// Use this for initialization void Awake() { _this = this; AddCardArray(); }