private void setupGame() { if (rbtThem.Checked || rbtUs.Checked) { lbxUsLibrary.Items.Clear(); AI.setTextBox(tbxAction); lbxEnemyLibrary.Items.Clear(); lbxTokens.Items.Clear(); //currentPhase = GameState.phase.StartGame; btnStartGame.Enabled = false; playerHealth = 20; enemyHealth = 20; tbxUsHealth.Text = playerHealth.ToString(); tbxEnemyHealth.Text = enemyHealth.ToString(); if (rbtKnights.Checked) { foreach (Card c in Cardmaker.Knights) { c.Library = lbxUsLibrary.Items; c.Hand = lbxUsHand.Items; c.Field = lbxUsField.Items; c.Graveyard = lbxUsGraveyard.Items; c.Exile = lbxUsExile.Items; c.e_Field = lbxEnemyField.Items; //c.MyLocation = c.Library; lbxUsLibrary.Items.Add(c); } KnightCards.GriffinToken GT = new KnightCards.GriffinToken(); GT.Library = lbxUsLibrary.Items; GT.Hand = lbxUsHand.Items; GT.Field = lbxUsField.Items; GT.Graveyard = lbxUsGraveyard.Items; GT.Exile = lbxUsExile.Items; GT.e_Field = lbxEnemyField.Items; lbxTokens.Items.Add(GT); foreach (Card c in Cardmaker.Dragons) { c.Library = lbxEnemyLibrary.Items; c.Hand = null; c.Field = lbxEnemyField.Items; c.Graveyard = lbxEnemyGraveyard.Items; c.Exile = lbxEnemyExile.Items; c.e_Field = lbxUsField.Items; //c.MyLocation = c.Library; lbxEnemyLibrary.Items.Add(c); } Card gob = new DragonCards.Goblin(); gob.Library = lbxEnemyLibrary.Items; gob.Hand = null; gob.Field = lbxEnemyField.Items; gob.Graveyard = lbxEnemyGraveyard.Items; gob.Exile = lbxEnemyExile.Items; gob.e_Field = lbxUsField.Items; lbxTokens.Items.Add(gob); } else { foreach (Card c in Cardmaker.Dragons) { c.Library = lbxUsLibrary.Items; c.Hand = lbxUsHand.Items; c.Field = lbxUsField.Items; c.Graveyard = lbxUsGraveyard.Items; c.Exile = lbxUsExile.Items; c.e_Field = lbxEnemyField.Items; //c.MyLocation = c.Library; lbxUsLibrary.Items.Add(c); } Card GT = new DragonCards.Goblin(); GT.Library = lbxUsLibrary.Items; GT.Hand = lbxUsHand.Items; GT.Field = lbxUsField.Items; GT.Graveyard = lbxUsGraveyard.Items; GT.Exile = lbxUsExile.Items; GT.e_Field = lbxEnemyField.Items; lbxTokens.Items.Add(GT); foreach (Card c in Cardmaker.Knights) { c.Library = lbxEnemyLibrary.Items; c.Hand = null; c.Field = lbxEnemyField.Items; c.Graveyard = lbxEnemyGraveyard.Items; c.Exile = lbxEnemyExile.Items; c.e_Field = lbxUsField.Items; //c.MyLocation = c.Library; lbxEnemyLibrary.Items.Add(c); } Card gob = new KnightCards.GriffinToken(); gob.Library = lbxEnemyLibrary.Items; gob.Hand = null; gob.Field = lbxEnemyField.Items; gob.Graveyard = lbxEnemyGraveyard.Items; gob.Exile = lbxEnemyExile.Items; gob.e_Field = lbxUsField.Items; lbxTokens.Items.Add(gob); } LinkedList <Card> untap = new LinkedList <Card>(); foreach (Card c in lbxUsLibrary.Items) { if (c.Tapped) { untap.AddLast(c); } } foreach (Card c in lbxEnemyLibrary.Items) { if (c.Tapped) { untap.AddLast(c); } } foreach (Card c in untap) { c.Tapped = false; c.Library.Remove(c); c.Library.Add(c); } } }