Beispiel #1
0
    private void Ready(SelectModel selectModel)
    {
        if (selectModel.UserID == GameData.user.ID)
        {
            //禁止点击操作
            SelectEventUtil.selected();
        }
        foreach (SelectModel item in room.TeamOne)
        {
            if (item.UserID == selectModel.UserID)
            {
                item.Hero    = selectModel.Hero;
                item.IsReady = true;
                //刷新UI界面
                SelectEventUtil.refreshView(room);

                return;
            }
        }
        foreach (SelectModel item in room.TeamTwo)
        {
            if (item.UserID == selectModel.UserID)
            {
                item.Hero    = selectModel.Hero;
                item.IsReady = true;
                //刷新UI界面
                SelectEventUtil.refreshView(room);
                return;
            }
        }
    }
Beispiel #2
0
    /// <summary>
    /// 选择英雄
    /// </summary>
    /// <param name="selectModel"></param>
    private void Select(SelectModel selectModel)
    {
        foreach (SelectModel item in room.TeamOne)
        {
            if (item.UserID == selectModel.UserID)
            {
                item.Hero = selectModel.Hero;
                //刷新UI界面
                SelectEventUtil.refreshView(room);

                return;
            }
        }
        foreach (SelectModel item in room.TeamTwo)
        {
            if (item.UserID == selectModel.UserID)
            {
                item.Hero = selectModel.Hero;
                //刷新UI界面
                SelectEventUtil.refreshView(room);

                return;
            }
        }
    }
Beispiel #3
0
    /// <summary>
    /// 其他人的进入
    /// </summary>
    /// <param name="id"></param>
    private void Enter(int id)
    {
        if (room == null)
        {
            return;
        }
        foreach (SelectModel item in room.TeamOne)
        {
            if (item.UserID == id)
            {
                item.IsEnter = true;
                //刷新UI界面
                SelectEventUtil.refreshView(room);

                return;
            }
        }
        foreach (SelectModel item in room.TeamTwo)
        {
            if (item.UserID == id)
            {
                item.IsEnter = true;
                //刷新UI界面
                SelectEventUtil.refreshView(room);

                return;
            }
        }
    }
Beispiel #4
0
 /// <summary>
 /// 自身的进入
 /// </summary>
 /// <param name="roomDTO"></param>
 private void Enter(SelectRoomDTO roomDTO)
 {
     room = roomDTO;
     SendMessage("CloseMask");
     //刷新界面UI
     SelectEventUtil.refreshView(room);
 }
Beispiel #5
0
 private void ready(SelectModel model)
 {
     if (model.userId == GameData.user.id)
     {
         //是自己准备了 进行状态处理 不准点击操作了
         SelectEventUtil.selected();
     }
     foreach (SelectModel item in room.teamOne)
     {
         if (item.userId == model.userId)
         {
             item.hero  = model.hero;
             item.ready = true;
             //刷新UI界面
             SelectEventUtil.refreshView(room);
             return;
         }
     }
     foreach (SelectModel item in room.teamTwo)
     {
         if (item.userId == model.userId)
         {
             item.hero  = model.hero;
             item.ready = true;
             //刷新UI界面
             SelectEventUtil.refreshView(room);
             return;
         }
     }
 }
Beispiel #6
0
 private void enter(SelectRoomDTO dto)
 {
     room = dto;
     SendMessage("closeMask");
     //刷新界面UI
     SelectEventUtil.refreshView(room);
 }
Beispiel #7
0
 private void select(SelectModel model)
 {
     foreach (SelectModel item in room.teamOne)
     {
         if (item.userId == model.userId)
         {
             item.hero = model.hero;
             //刷新UI界面
             SelectEventUtil.refreshView(room);
             return;
         }
     }
     foreach (SelectModel item in room.teamTwo)
     {
         if (item.userId == model.userId)
         {
             item.hero = model.hero;
             //刷新UI界面
             SelectEventUtil.refreshView(room);
             return;
         }
     }
 }