void ShowRobotytList()
    {
        robotyt = new yuan.YuanMemoryDB.YuanTable("", "");

        objRobotRow = BtnGameManager.yt[0].CopyTo();
        objRobotRow["ProID"].YuanColumnText       = "1";
        objRobotRow["PlayerLevel"].YuanColumnText = "2";
        objRobotRow["PlayerName"].YuanColumnText  = StaticLoc.Loc.Get("info1071");
        objRobotRow["PlayerID"].YuanColumnText    = "-10";


        objRobotRow1 = BtnGameManager.yt[0].CopyTo();
        objRobotRow1["ProID"].YuanColumnText       = "2";
        objRobotRow1["PlayerLevel"].YuanColumnText = "2";
        objRobotRow1["PlayerName"].YuanColumnText  = StaticLoc.Loc.Get("info1072");
        objRobotRow1["PlayerID"].YuanColumnText    = "-10";

        objRobotRow2 = BtnGameManager.yt[0].CopyTo();
        objRobotRow2["ProID"].YuanColumnText         = "3";
        objRobotRow2["PlayerLevel"].YuanColumnText   = "2";
        objRobotRow2["PlayerName"].YuanColumnText    = StaticLoc.Loc.Get("info1073");
        objRobotRow2["PlayerID"].YuanColumnText      = "-10";
        objRobotRow2["EquipItem"].YuanColumnText     = "3101143624100000003000000;;;;;;6201322311121000000000000,01;;;;;;";
        objRobotRow2["Skill"].YuanColumnText         = "30;20;20;20;20;20;10;10;00;20;20;20;10;10;00;20;20;20;10;10;20;10;10;";
        objRobotRow2["SkillsPostion"].YuanColumnText = "0,,;0,,;24,14,ProID_314;12,03,ProID_303;";

//		robotyt.Add (objRobotRow);
//		robotyt.Add (objRobotRow1);
        robotyt.Add(objRobotRow2);
    }
Esempio n. 2
0
    public void Sort(SortType mSortType, string mSortRowName, string mKeyName)
    {
        if (mSortType == SortType.desc)
        {
            Dictionary <string, int> dic = new Dictionary <string, int>();

            for (int i = 0; i < yt.Rows.Count; i++)
            {
                dic.Add(yt.Rows[i][mKeyName].YuanColumnText, int.Parse(yt.Rows[i][mSortRowName].YuanColumnText));
            }

            var result = from pair in dic orderby pair.Value descending select pair;

            yuan.YuanMemoryDB.YuanTable tempTable = new yuan.YuanMemoryDB.YuanTable("", "");
            tempTable.Rows = yt.Rows;
            yt.Rows        = new List <yuan.YuanMemoryDB.YuanRow>();
            foreach (KeyValuePair <string, int> r in result)
            {
                yt.Add(tempTable.SelectRowEqual(mKeyName, r.Key));
            }
        }
        else if (mSortType == SortType.asc)
        {
            Dictionary <string, int> dic = new Dictionary <string, int>();

            for (int i = 0; i < yt.Rows.Count; i++)
            {
                dic.Add(yt.Rows[i][mKeyName].YuanColumnText, int.Parse(yt.Rows[i][mSortRowName].YuanColumnText));
            }

            var result = from pair in dic orderby pair.Value ascending select pair;

            yuan.YuanMemoryDB.YuanTable tempTable = new yuan.YuanMemoryDB.YuanTable("", "");
            tempTable.Rows = yt.Rows;
            yt.Rows        = new List <yuan.YuanMemoryDB.YuanRow>();
            foreach (KeyValuePair <string, int> r in result)
            {
                yt.Add(tempTable.SelectRowEqual(mKeyName, r.Key));
            }
        }

        SetPage(0);
    }
Esempio n. 3
0
    void Start()
    {
        yt.Add(YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytMapLevel.SelectRowEqual("MapID", Application.loadedLevelName.Substring(3, 3)));
        SC = this;
//		Dictionary<int, bool> selectchannel = new Dictionary<int, bool>();
//
//		for(int i=0;i<30;i++)
//		{
//			selectchannel.Add(i, i%2==0);
//		}
//		ShowSelectChannel(selectchannel);
    }
Esempio n. 4
0
    public void SetPage(int mNum)
    {
        //NGUIDebug.Log(string.Format("---------------------Click:{0},ytCount:{1}", mNum,yt==null?0:yt.Rows.Count));
        if ((eventList != null || eventListBack != null) && mNum >= 0)
        {
            //NGUIDebug.Log("++++++++++++++++11111111111111");
            int tempNum = 0;
            pageNumStart = listNum * mNum;
            pageNumEnd   = pageNumStart + listNum - 1;
            //NGUIDebug.Log("++++++++++++++++22222222222222");
            if (yt.Rows.Count > pageNumStart)
            {
                //NGUIDebug.Log(string.Format("----------------------------mNum:{0},ytCount:{1}", mNum, yt.Count));
                ytPage.Clear();
                foreach (yuan.YuanMemoryDB.YuanRow yr in yt.Rows)
                {
                    if (tempNum >= pageNumStart && tempNum <= pageNumEnd)
                    {
                        ytPage.Add(yr);
                    }
                    if (tempNum >= pageNumEnd)
                    {
                        break;
                    }
                    tempNum++;
                }
                //NGUIDebug.Log("11111111111111111111111");
                if (eventList != null)
                {
                    //NGUIDebug.Log(string.Format("2222222222222222222222222-------:{0}", eventList.Target == null ? eventList.Method.Name : eventList.Target.ToString()));
                    eventList(ytPage);
                }
                if (eventListBack != null)
                {
                    //NGUIDebug.Log(string.Format("3333333333333333333333333-------:{0}", eventListBack.Target == null ? eventListBack.Method.Name : eventListBack.Target.ToString()));
                    eventListBack(ytPage, myGrid, myListBtns, myBtnFunction, myDegSetBtn, myName);
                }

                nowPage = mNum;
                if (nowPage == 0)
                {
                    pageUp.myButton.isEnabled = false;
                }
                else
                {
                    pageUp.myButton.isEnabled = true;
                }
                if (yt.Rows.Count - 1 <= pageNumEnd)
                {
                    pageDown.myButton.isEnabled = false;
                }
                else
                {
                    pageDown.myButton.isEnabled = true;
                }
                if (lblNowPage != null)
                {
                    lblNowPage.text = (nowPage + 1) + "/" + maxPage;
                }
            }
        }
    }