Example #1
0
        public override bool readFromXmlElement(XmlNode pCurNode)
        {
            XmlElement ele = (XmlElement)pCurNode;

            if (ele.Name != "HoldCardContribute")
            {
                s_errorString = "error xml type error for HoldCardContribute";
                return(false);
            }

            if (ele.HasAttribute("count") == false)
            {
                s_errorString = "error xml type HoldCardContribute do not have count attribute";
                return(false);
            }

            m_nValue = int.Parse(ele.GetAttribute("count"));

            XmlNode pchild = pCurNode.FirstChild;

            while (pchild != null)
            {
                NodeBettimes pnodeChild = new NodeBettimes(0);
                pnodeChild.readFromXmlElement(pchild);
                addChildNode(pnodeChild);
                pchild = pchild.NextSibling;
            }
            return(true);
        }
Example #2
0
        public override void refreshCurNodeData(NodeData nCurData)
        {
            base.refreshCurNodeData(nCurData);
            m_panel.enableAddNodeBtn = false;
            m_descLabel.Text         = string.Format("当前是{0},\n最终牌型是{1},\n{2} ,\n", nCurData.m_pParentNode.m_pParentNode.m_pParentNode.m_pParentNode.desc, nCurData.m_pParentNode.m_pParentNode.m_pParentNode.desc, nCurData.m_pParentNode.desc);
            NodeBettimes ret       = (NodeBettimes)nCurData;
            string       strStrage = string.Format("当场上最大下注{0}倍盲注 \n 跟注概率{1}\n 过牌概率{2} \nALL In概率{3}\n 加注概率{4}\n 加注下限{5}倍盲注 \n加注上限{6}倍盲注",
                                                   ret.m_nValue, ret.nFollowRate, ret.nPassRate, ret.nALLInRate, ret.nAddRate, ret.nAddLowLimit, ret.nAddTopLimit);

            m_descLabel.Text = m_descLabel.Text + strStrage;
        }
        public override TreeNode doAddChildNode()
        {
            int nIdx = (int)m_pBetTimes.Value;

            if (m_pCurNodeData.isNodeValueAlreadyExist(nIdx))
            {
                MessageBox.Show("already have this bet times node");
                return(null);
            }


            if (m_pFollow.Value + m_pPass.Value + m_pAdd.Value + m_pAllIn.Value != 100)
            {
                MessageBox.Show("权重总和不等于100");
                return(null);
            }

            if (m_pAdd.Value > 0 && m_pAddLowLimit.Value > m_pAddTopLimit.Value)
            {
                MessageBox.Show("加注权重下限大于上限");
                return(null);
            }

            NodeBettimes pNodeData = new NodeBettimes(nIdx);

            pNodeData.nFollowRate  = (int)m_pFollow.Value;
            pNodeData.nPassRate    = (int)m_pPass.Value;
            pNodeData.nAddRate     = (int)m_pAdd.Value;
            pNodeData.nALLInRate   = (int)m_pAllIn.Value;
            pNodeData.nAddLowLimit = (int)m_pAddLowLimit.Value;
            pNodeData.nAddTopLimit = (int)m_pAddTopLimit.Value;

            if (pNodeData.checkAllValueValid() == false)
            {
                MessageBox.Show("add node error , value not valid, rate toall must = 100 , uplimit should bigger than lowLimit");
                return(null);
            }

            if (m_pCurNodeData.addChildNode(pNodeData) == null)
            {
                MessageBox.Show("add node error , value not valid, rate toall must = 100 , uplimit should bigger than lowLimit");
                return(null);
            }

            TreeNode pnode = new TreeNode();

            pnode.Tag  = pNodeData;
            pnode.Text = pNodeData.desc;
            refreshCurNodeData(m_pCurNodeData);
            return(pnode);
        }
        public override TreeNode doAddChildNode()
        {
            int nIdx = (int)m_pBetTimes.Value;
            if (m_pCurNodeData.isNodeValueAlreadyExist(nIdx))
            {
                MessageBox.Show("already have this bet times node");
                return null;
            }

            if (m_pFollow.Value + m_pPass.Value + m_pAdd.Value + m_pAllIn.Value != 100)
            {
                MessageBox.Show("权重总和不等于100");
                return null;
            }

            if ( m_pAdd.Value > 0 && m_pAddLowLimit.Value > m_pAddTopLimit.Value)
            {
                MessageBox.Show("加注权重下限大于上限");
                return null;
            }

            NodeBettimes pNodeData = new NodeBettimes(nIdx);
            pNodeData.nFollowRate = (int)m_pFollow.Value;
            pNodeData.nPassRate = (int)m_pPass.Value;
            pNodeData.nAddRate = (int)m_pAdd.Value;
            pNodeData.nALLInRate = (int)m_pAllIn.Value;
            pNodeData.nAddLowLimit = (int)m_pAddLowLimit.Value;
            pNodeData.nAddTopLimit = (int)m_pAddTopLimit.Value;

            if (pNodeData.checkAllValueValid() == false )
            {
                MessageBox.Show("add node error , value not valid, rate toall must = 100 , uplimit should bigger than lowLimit");
                return null;
            }

            if (m_pCurNodeData.addChildNode(pNodeData) == null)
            {
                MessageBox.Show("add node error , value not valid, rate toall must = 100 , uplimit should bigger than lowLimit");
                return null;
            }

            TreeNode pnode = new TreeNode();
            pnode.Tag = pNodeData;
            pnode.Text = pNodeData.desc;
            refreshCurNodeData(m_pCurNodeData);
            return pnode;
        }
Example #5
0
        public override bool readFromXmlElement(XmlNode pCurNode)
        {
            XmlElement ele = (XmlElement)pCurNode;
            if (ele.Name != "HoldCardContribute")
            {
                s_errorString = "error xml type error for HoldCardContribute";
                return false;
            }

            if (ele.HasAttribute("count") == false)
            {
                s_errorString = "error xml type HoldCardContribute do not have count attribute";
                return false;
            }

            m_nValue = int.Parse(ele.GetAttribute("count"));

            XmlNode pchild = pCurNode.FirstChild;
            while (pchild != null)
            {
                NodeBettimes pnodeChild = new NodeBettimes(0);
                pnodeChild.readFromXmlElement(pchild);
                addChildNode(pnodeChild);
                pchild = pchild.NextSibling;
            }
            return true;
        }