Beispiel #1
0
        public void initMgr()
        {
            int lv   = (int)PlayerModel.getInstance().lvl;
            var xml  = XMLMgr.instance.GetSXML("func_open");
            var list = xml.GetNodeList("func");

            foreach (var v in list)
            {
                FunctionItem item = new FunctionItem();
                item.id    = v.getInt("id");
                item.type  = v.getInt("type");
                item.show  = v.getInt("show") == 1 ? true : false;
                item.pos_x = v.getFloat("state_x");
                item.pos_y = v.getFloat("state_y");
                if (item.type == 1)
                {
                    int param = v.getInt("param1");
                    item.main_task_id = param;
                }
                else if (item.type == 2)
                {
                    string[] param = v.getString("param1").Split(',');
                    item.zhuan = int.Parse(param[0]);
                    item.lv    = int.Parse(param[1]);
                }
                else if (item.type == 3)
                {
                    item.legionlvl = v.getInt("param1");
                }
                dItem[item.id] = item;
            }
        }
Beispiel #2
0
        public void initMgr()
        {
            int lvl = (int)ModelBase <PlayerModel> .getInstance().lvl;

            SXML        sXML     = XMLMgr.instance.GetSXML("func_open", "");
            List <SXML> nodeList = sXML.GetNodeList("func", "");

            foreach (SXML current in nodeList)
            {
                FunctionItem functionItem = new FunctionItem();
                functionItem.id    = current.getInt("id");
                functionItem.type  = current.getInt("type");
                functionItem.show  = (current.getInt("show") == 1);
                functionItem.pos_x = current.getFloat("state_x");
                functionItem.pos_y = current.getFloat("state_y");
                bool flag = functionItem.type == 1;
                if (flag)
                {
                    int @int = current.getInt("param1");
                    functionItem.main_task_id = @int;
                }
                else
                {
                    bool flag2 = functionItem.type == 2;
                    if (flag2)
                    {
                        string[] array = current.getString("param1").Split(new char[]
                        {
                            ','
                        });
                        functionItem.zhuan = int.Parse(array[0]);
                        functionItem.lv    = int.Parse(array[1]);
                    }
                    else
                    {
                        bool flag3 = functionItem.type == 3;
                        if (flag3)
                        {
                            functionItem.legionlvl = current.getInt("param1");
                        }
                    }
                }
                this.dItem[functionItem.id] = functionItem;
            }
        }