Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        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;
            }
        }
Ejemplo n.º 3
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());
        }
Ejemplo n.º 4
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());
        }