void AIGetPlacing() { AIGameState InitialState = new AIGameState(/*MyHandCards,*/ MyTableCards, AIHandCards, AITableCards, MyHero, AIHero, maxMana, MyMana, AIMana, turn, null); InitialState.GetAllPlacingAction(); //Find Best Score float MaxScore = float.MinValue; AIGameState BestState = new AIGameState(); foreach (AIGameState item in AIGameState.AllStates) { if (item.State_Score > MaxScore) { MaxScore = item.State_Score; BestState = item; } } int count = BestState.Actions.Count; //GetActions for (int i = 0; i < count; i++) { AIGameState.Action a; a = BestState.Actions.Dequeue(); if (a.OpCode == 0) { foreach (var item in AIHandCards) { if (item.GetComponent <CardBehaviourScript>()._name == a.Card1) { PlaceCard(item.GetComponent <CardBehaviourScript>()); break; } } } } AIGameState.AllStates.Clear(); }