Exemplo n.º 1
0
        public void refresh(JToken tok)
        {
            load_.Clear();
            maxLoad_ = 0;
            JEnumerable <JToken> children = tok.Children();

            foreach (JToken child in children)
            {
                TrainLoad l = new TrainLoad(child);
                load_.Add(l);
                if (l.Amount > maxLoad_)
                {
                    maxLoad_ = l.Amount;
                }
            }
        }
Exemplo n.º 2
0
 public void Clear()
 {
     Load.Clear();
 }
Exemplo n.º 3
0
    private void Init()
    {
        if (loadView)
        {
            loadView.Clear();
            loadView = null;
        }
        gameModel.isLogin = true;
        if (isFightEnd)
        {
            isFightEnd = false;
            //主界面
            //			ViewManager.inst.ShowScene (new MediatorFightWorld ());
            if (fightModel.fightType == ModelFight.FIGHT_MATCHTEAM)
            {
            }
            else if (fightModel.fightType == ModelFight.FIGHT_MATCH)
            {
//				Debug.LogError (fightModel.fightType);
                //				NetSocket.inst.AddListener (NetBase.SOCKET_GETRESUILTPUSH, (VoSocket vo) =>
                //				{
                //					NetSocket.inst.RemoveListener (NetBase.SOCKET_GETRESUILTPUSH);
                //
                //					Dictionary<string,object> data = new Dictionary<string, object> ();
                //					data ["data"] = vo.data;
                //					data ["type"] = fightModel.fightType;
                //					DispatchManager.inst.Dispatch (new MainEvent (MainEvent.FIGHT_RESULT, data));
                //				});
                //				NetSocket.inst.Send (NetBase.SOCKET_GETRESUILT, null);
//				if (fightModel.fightResult != null) {
//					DispatchManager.inst.Dispatch (new MainEvent (MainEvent.FIGHT_RESULT, fightModel.fightResult));
//				}
            }
            else if (fightModel.fightType == ModelFight.FIGHT_MATCHGUIDE)
            {
//				Debug.Log ("Main match_guide init");
                Debug.Log("HTTP_DOGUIDE + test");
                if (GuideManager.inst.Check("0:0"))
                {
                    userModel.SetGuide(1, Guide_fight);
                }
                else if (GuideManager.inst.Check("2:1"))
                {
                    userModel.SetGuide(3, Guide_fight);
                }
                else if (GuideManager.inst.Check("4:0"))
                {
                    //临时 测试 单机 接口

                    NetHttp.inst.Send(NetBase.HTTP_DOGUIDE + "_test", new Dictionary <string, object> (), Guide_fight);
                }
                else
                {
                    NetHttp.inst.Send(NetBase.HTTP_DOGUIDE + "_test", new Dictionary <string, object> (), Guide_fight);
                }
            }
            else
            {
                NetSocket.inst.AddListener(NetBase.SOCKET_GETRESULTFREEMATCHPUSH, (VoSocket vo) => {
                    NetSocket.inst.RemoveListener(NetBase.SOCKET_GETRESULTFREEMATCHPUSH);

                    Dictionary <string, object> data = new Dictionary <string, object>();
                    data["data"] = vo.data;
                    data["type"] = fightModel.fightType;
                    DispatchManager.inst.Dispatch(new MainEvent(MainEvent.FIGHT_RESULT, data));
                });
                NetSocket.inst.Send(NetBase.SOCKET_GETRESULTFREEMATCH, null);
            }
        }
        else
        {
            if (GuideManager.inst.Check("0:0"))
            {
                //			GuideManager.inst.Next ();
                //			GuideManager.inst.Show (this);
//				BtnMatch_Click ();//第一场战斗
                ModelManager.inst.fightModel.fightType = ModelFight.FIGHT_MATCHGUIDE;                //新手引导战斗//临时 测试演示战斗
                DispatchManager.inst.Dispatch(new MainEvent(MainEvent.START_FIGHT, PlayerData.instance.data));
                return;
            }
            else
            {
                //主界面
                ViewManager.inst.ShowScene <MediatorMain> ();
                //离线卡牌
                if (userModel.records ["guild_support_logs"] != null)
                {
                    ViewManager.inst.ShowView <MediatorLoginCard> ();
                }
            }
        }

//		Socket_Start ();
    }