public void GetAction(HandHistory history, out holdem_engine.Action.ActionTypes type, out double amount) { PokerHandHistory.PokerHand xml = history.ToXmlHand(); PokerHandHistory.PokerHandXML hands = new PokerHandHistory.PokerHandXML() { Hands = new PokerHandHistory.PokerHand[] { xml } }; StringBuilder sb = new StringBuilder(); using (TextWriter writer = new StringWriter(sb)) { XmlSerializer ser = new XmlSerializer(typeof(PokerHandHistory.PokerHandXML)); ser.Serialize(writer, hands); } Console.WriteLine(sb.ToString()); if (actions != null && curAction < actions.Length) { holdem_engine.Action action = actions[curAction++]; type = action.ActionType; amount = action.Amount; } else { type = holdem_engine.Action.ActionTypes.Fold; amount = 0; } }
public void TestHistory() { PokerHandHistory.PokerHand xml = hist.ToXmlHand(); PokerHandHistory.PokerHandXML hands = new PokerHandHistory.PokerHandXML() { Hands = new PokerHandHistory.PokerHand[] { xml } }; StringBuilder sb = new StringBuilder(); using (TextWriter writer = new StringWriter(sb)) { XmlSerializer ser = new XmlSerializer(typeof(PokerHandHistory.PokerHandXML)); ser.Serialize(writer, hands); } Console.WriteLine(sb.ToString()); }