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; } } }
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; } } }