protected void genFishTable(Table table, InfoFishPark info)
        {
            GMUser user = (GMUser)Session["user"];

            TableRow tr = new TableRow();

            table.Rows.Add(tr);

            int i = 0;

            for (; i < s_head.Length; i++)
            {
                TableCell td = new TableCell();
                tr.Cells.Add(td);
                td.Text = s_head[i];
            }

            if (info.m_fish == null)
            {
                return;
            }

            for (i = 0; i < info.m_fish.Count; i++)
            {
                DbFish item = info.m_fish[i];
                m_content[0] = item.fishid.ToString();
                FishCFGData data = FishParkCFG.getInstance().getValue(item.fishid);
                if (data != null)
                {
                    m_content[1] = data.m_fishName;
                }

                m_content[2] = item.hitcount.ToString();
                m_content[3] = item.deadcount.ToString();
                m_content[4] = item.totalincome.ToString();
                m_content[5] = item.totaloutlay.ToString();

                tr = new TableRow();
                table.Rows.Add(tr);
                for (int j = 0; j < s_head.Length; j++)
                {
                    TableCell td = new TableCell();
                    tr.Cells.Add(td);
                    td.Text = m_content[j];
                }
            }
        }
示例#2
0
    public void onQuery(GMUser user, Table table, int roomIndex, QueryType qtype)
    {
        TableRow tr = new TableRow();

        table.Rows.Add(tr);

        int i = 0;

        for (; i < s_head.Length; i++)
        {
            TableCell td = new TableCell();
            tr.Cells.Add(td);
            td.Text = s_head[i];
        }

        OpRes             res     = user.doQuery(roomIndex, qtype /*QueryType.queryTypeFishStat*/);
        List <ResultFish> qresult = (List <ResultFish>)user.getQueryResult(qtype);

        foreach (var data in qresult)
        {
            m_content[0] = data.m_fishId.ToString();
            FishCFGData fishInfo = null;
            if (qtype == QueryType.queryTypeFishStat) // 经典捕鱼
            {
                fishInfo = FishCFG.getInstance().getValue(data.m_fishId);
            }
            else // 鳄鱼公园
            {
                fishInfo = FishParkCFG.getInstance().getValue(data.m_fishId);
            }
            if (fishInfo != null)
            {
                m_content[1] = fishInfo.m_fishName;
            }
            else
            {
                m_content[1] = "";
            }
            m_content[2] = data.m_hitCount.ToString();
            m_content[3] = data.m_dieCount.ToString();
            m_content[4] = data.getHit_Die();
            m_content[5] = data.m_outlay.ToString();
            m_content[6] = data.m_income.ToString();
            m_content[7] = data.getOutlay_Income();
            if (data.m_roomId > 0)
            {
                m_content[8] = StrName.s_fishRoomName[data.m_roomId - 1];
            }
            else
            {
                m_content[8] = "";
            }

            tr = new TableRow();
            table.Rows.Add(tr);
            for (int j = 0; j < s_head.Length; j++)
            {
                TableCell td = new TableCell();
                tr.Cells.Add(td);
                td.Text = m_content[j];
            }
        }
    }