public void InitItem(RoleData data) { this.gameObject.SetActive(true); this.MyRoleData = data; this.transform.localPosition = new Vector3(-210, 4, 0); this.MyOrigPos = this.transform.localPosition; this.Icon.spriteName = "t_" + data.iconName; }
public void InitItem(RoleData data) { this.gameObject.SetActive(true); this.MyMove = this.gameObject.GetComponent<Move>(); this.MyRoleData = data; this.Sprite_Hero.spriteName = data.iconName; this.Sprite_Hero.MakePixelPerfect(); this.Sprite_Hero.transform.localScale = Vector3.one * 0.5f; }
/// <summary> /// Método para executar a proc pr_selecionar_perfilassociado /// </summary> public List<PerfilAcessoVO> ListarPerfilAssociado(short? codSubMenu) { List<RolesVO> listaRoles = new RoleData().ListarPerfilAssociado(codSubMenu); List<PerfilAcessoVO> listaPerfilAcesso = new List<PerfilAcessoVO>(); foreach ( RolesVO identRoles in listaRoles ) { PerfilAcessoVO identPerfilAcesso = new PerfilAcessoVO(); identPerfilAcesso.CodPerfilAcesso = identRoles.PerfilAcesso.CodPerfilAcesso; identPerfilAcesso.NomPerfilAcesso = identRoles.PerfilAcesso.NomPerfilAcesso; listaPerfilAcesso.Add(identPerfilAcesso); } return listaPerfilAcesso; }
public static List<RoleData> GetRoles() { RoleData r = null; List<RoleData> roleList = new List<RoleData>(); string[] ary = Roles.GetAllRoles(); foreach (string s in ary) { r = new RoleData(); r.RoleName = s; roleList.Add(r); } return roleList; }
public virtual IEnumerable <HospitalInfo> GetHospitals(RoleData roleData) { return(_trustApplicationService.GetHospitals()); }
/// <summary> /// 设置插入数据的命令 /// </summary> /// <param name="entity">实体对象</param> /// <param name="cmd">命令</param> /// <returns>返回真说明要取主键</returns> protected sealed override bool SetInsertCommand(RoleData entity, MySqlCommand cmd) { cmd.CommandText = InsertSqlCode; CreateFullSqlParameter(entity, cmd); return(true); }
/// <summary> /// 设置插入数据的命令 /// </summary> /// <param name="entity">实体对象</param> /// <param name="cmd">命令</param> /// <returns>返回真说明要取主键</returns> private void CreateFullSqlParameter(RoleData entity, MySqlCommand cmd) { //02:标识(Id) cmd.Parameters.Add(new MySqlParameter("Id", MySqlDbType.Int32) { Value = entity.Id }); //04:角色(Role) var isNull = string.IsNullOrWhiteSpace(entity.Role); var parameter = new MySqlParameter("Role", MySqlDbType.VarString, isNull ? 10 : (entity.Role).Length); if (isNull) { parameter.Value = DBNull.Value; } else { parameter.Value = entity.Role; } cmd.Parameters.Add(parameter); //05:标题(Caption) isNull = string.IsNullOrWhiteSpace(entity.Caption); parameter = new MySqlParameter("Caption", MySqlDbType.VarString, isNull ? 10 : (entity.Caption).Length); if (isNull) { parameter.Value = DBNull.Value; } else { parameter.Value = entity.Caption; } cmd.Parameters.Add(parameter); //06:备注(Memo) isNull = string.IsNullOrWhiteSpace(entity.Memo); parameter = new MySqlParameter("Memo", MySqlDbType.Text, isNull ? 10 : (entity.Memo).Length); if (isNull) { parameter.Value = DBNull.Value; } else { parameter.Value = entity.Memo; } cmd.Parameters.Add(parameter); //07:数据状态(DataState) cmd.Parameters.Add(new MySqlParameter("DataState", MySqlDbType.Int32) { Value = (int)entity.DataState }); //08:数据是否已冻结(IsFreeze) cmd.Parameters.Add(new MySqlParameter("IsFreeze", MySqlDbType.Byte) { Value = entity.IsFreeze ? (byte)1 : (byte)0 }); //09:制作人(AuthorID) cmd.Parameters.Add(new MySqlParameter("AuthorID", MySqlDbType.Int32) { Value = entity.AuthorID }); //10:制作时间(AddDate) isNull = entity.AddDate.Year < 1900; parameter = new MySqlParameter("AddDate", MySqlDbType.DateTime); if (isNull) { parameter.Value = DBNull.Value; } else { parameter.Value = entity.AddDate; } cmd.Parameters.Add(parameter); //11:最后修改者(LastReviserID) cmd.Parameters.Add(new MySqlParameter("LastReviserID", MySqlDbType.Int32) { Value = entity.LastReviserID }); //12:最后修改日期(LastModifyDate) isNull = entity.LastModifyDate.Year < 1900; parameter = new MySqlParameter("LastModifyDate", MySqlDbType.DateTime); if (isNull) { parameter.Value = DBNull.Value; } else { parameter.Value = entity.LastModifyDate; } cmd.Parameters.Add(parameter); //13:审核状态(AuditState) cmd.Parameters.Add(new MySqlParameter("AuditState", MySqlDbType.Int32) { Value = (int)entity.AuditState }); //14:审核人(AuditorId) cmd.Parameters.Add(new MySqlParameter("AuditorId", MySqlDbType.Int32) { Value = entity.AuditorId }); //15:审核时间(AuditDate) isNull = entity.AuditDate.Year < 1900; parameter = new MySqlParameter("AuditDate", MySqlDbType.DateTime); if (isNull) { parameter.Value = DBNull.Value; } else { parameter.Value = entity.AuditDate; } cmd.Parameters.Add(parameter); }
public virtual IEnumerable <ClinicianInfo> GetClinicians(RoleData roleData, int?hospitalId, string specialtyCode) { return(_trustApplicationService.GetClinicians(hospitalId, specialtyCode)); }
public void OpenXiLianPop(RoleData r) { MainUI.Instance.XiLianLClick(r); }
private void InitPlayerInfo(RoleData roleData, GameObject go, Player player, int instanceId) { PlayerInfo pi = go.GetComponent <PlayerInfo>(); pi.Init(this, roleData, player, instanceId); }
protected static RoleData CloneRole(RoleData data, WorldName world, Role.RoleFillFrom fillType) { RoleData.ConstructorData conData = new RoleData.ConstructorData(); conData.World = world; conData.Type = data.mType; conData.MaxSpecCount = data.mMaxSpecCount; conData.MidSpecCount = data.mMidSpeCount; conData.MinSpecCount = data.mMinSpecCount; conData.StartTime = data.mStartTime; conData.EndTime = data.mEndTime; conData.AgeSpecies = data.mAgeSpecies;// | CASAgeGenderFlags.YoungAdult | CASAgeGenderFlags.Adult | CASAgeGenderFlags.Elder; conData.Motives = data.mMotives; conData.FillRollFrom = fillType; conData.ValidProductVersion = data.mValidProductVersion; conData.MotivesToFreeze = data.mMotivesToFreeze; conData.UseHoverbot = data.mUseHoverbot; conData.UseServobot = data.mUseServobot; conData.MaleUniform = null; conData.FemaleUniform = null; conData.MaleUniformElder = null; conData.FemaleUniformElder = null; conData.FutureWorldMaleUniform = null; conData.FutureWorldFemaleUniform = null; conData.FutureWorldMaleUniformElder = null; conData.FutureWorldFemaleUniformElder = null; RoleData r = new RoleData(conData); r.mFemaleUniform = data.mFemaleUniform; r.mFemaleUniformElder = data.mFemaleUniformElder; r.mMaleUniform = data.mMaleUniform; r.mMaleUniformElder = data.mMaleUniformElder; r.mFutureWorldFemaleUniform = data.mFutureWorldFemaleUniform; r.mFutureWorldFemaleUniformElder = data.mFutureWorldFemaleUniformElder; r.mFutureWorldMaleUniform = data.mFutureWorldMaleUniform; r.mFutureWorldMaleUniformElder = data.mFutureWorldMaleUniformElder; return r; }
private static bool IsSimGoodForRoleCommonTest(IMiniSimDescription desc, RoleData data, IRoleGiver roleGiver, out string reason) { WorldName homeWorld = desc.HomeWorld; /* bool isCelebrity = desc.IsCelebrity; if (!data.CanBeCelebrity && isCelebrity) { reason = "Celebrity Fail"; return false; } */ if ((CASUtils.CASAGSAvailabilityFlagsFromCASAgeGenderFlags(desc.Age | desc.Species) & data.AvailableAgeSpecies) == CASAGSAvailabilityFlags.None) { reason = "Age/Species Fail"; return false; } SimDescription description = desc as SimDescription; if (((description != null) && (description.CreatedSim == null)) && (description.WillAgeUpOnInstantiation && ((CASUtils.CASAGSAvailabilityFlagsFromCASAgeGenderFlags(AgingState.GetNextOlderAge(desc.Age, desc.Species) | desc.Species) & data.AvailableAgeSpecies) == CASAGSAvailabilityFlags.None))) { reason = "Age/Species Fail"; return false; } if (data.FillRoleFrom == Role.RoleFillFrom.PeopleWhoDontLiveInThisWorld) { if ((homeWorld != WorldName.TouristWorld) && (GameUtils.GetWorldType(homeWorld) != WorldType.Vacation) && (GameUtils.GetWorldType(homeWorld) != WorldType.Future)) { reason = "Vacation World Fail"; return false; } if (homeWorld == GameUtils.GetCurrentWorld()) { reason = "Home World Fail"; return false; } if (GameUtils.GetWorldType(homeWorld) == WorldType.Future) { if (Sims3.Gameplay.Queries.CountObjects<ITimePortal>() == 0) { reason = "Time Portal Fail"; return false; } } } /* else if (data.FillRoleFrom == RoleFillFrom.CustomCreatedSim) { return false; } */ IRoleGiverCustomIsSimGoodTest test = roleGiver as IRoleGiverCustomIsSimGoodTest; if ((test != null) && (!test.IsSimGoodForRole(desc))) { reason = "Role Giver Fail"; return false; } reason = "Success"; return true; }
public static bool IsSimGoodForRole(IMiniSimDescription sim, RoleData role, IRoleGiver roleGiver, out string reason) { if (role == null) { reason = "No Role"; return false; } if (!IsSimValidForAnyRole(sim, role.Type, out reason)) return false; return IsSimGoodForRoleCommonTest(sim, role, roleGiver, out reason); }
public static bool IsSimGoodForRole(IMiniSimDescription sim, RoleData role, IRoleGiver roleGiver) { string reason = null; return IsSimGoodForRole(sim, role, roleGiver, out reason); }
/// <summary> /// 申请组队,返回队伍信息 /// </summary> /// <param name="request"></param> /// <param name="response"></param> /// <param name="peer"></param> /// <param name="sendParameters"></param> void OnBattleTeam(OperationRequest request, OperationResponse response, ClientPeer peer, SendParameters sendParameters) { Dictionary <byte, object> dicPara = request.Parameters; object value; if (dicPara.TryGetValue((byte)ParameterCode.BattleInfo, out value)) { // 申请进入的副本ID peer.m_strRoomID = value.ToString(); } if (DataManager.Instance != null) { // 获取副本中角色出生点位置 peer.m_pRoleSpawn = DataManager.Instance.GetRoomSpawn(peer.m_strRoomID); } List <ClientPeer> pAllPeer = MyGameApplication.MyInstance.GetTeam(peer.m_strRoomID); if (pAllPeer != null) { // 满足队伍请求:创建一个Team,把队伍中角色信息返回给客户端 int nLenth = pAllPeer.Count; // 队伍中只能取两个 if (nLenth > 2) { nLenth = 2; } List <ClientPeer> pTeam = new List <ClientPeer>(); for (int i = 0; i < nLenth; ++i) { pTeam.Add(pAllPeer[i]); // 组队成功,移除Peer MyGameApplication.MyInstance.RemovePeer(pAllPeer[i].m_strRoomID, pAllPeer[i]); } // 把当前的Peer加入进去 pTeam.Add(peer); m_Team = new BattleTeam(pTeam); //排序 pTeam.Sort(SortTeamRole); // 返回队伍中角色信息:所有peer都应该返回角色信息 // 当前Peer返回给对应客户端角色信息 string strRes = ""; for (int j = 0; j < pTeam.Count; ++j) { RoleData curRole = pTeam[j].m_curRole; strRes += curRole.Id + "," + curRole.Name + "," + curRole.Lv + "," + curRole.IsMan + "," + curRole.Occup + "," + curRole.User.Id + "," + curRole.Server.ID + "," + (j + 1).ToString() + "|"; // 初始化角色出生点位置 if (peer.m_pRoleSpawn != null && 3 == peer.m_pRoleSpawn.Count) { RoleSpawn curSpawn = peer.m_pRoleSpawn[j]; Vector3 curPos = new Vector3(curSpawn.m_fX, curSpawn.m_fY, curSpawn.m_fZ); pTeam[j].m_vCurPos = curPos; } } Dictionary <byte, object> dic = new Dictionary <byte, object>(); dic.Add((byte)ParameterCode.BattleInfo, strRes); response.ReturnCode = (short)ReturnCode.GotTeam; response.Parameters = dic; // 通知队伍中的其他Peer返回队伍角色信息给客户端 for (int k = 0; k < pTeam.Count; ++k) { ClientPeer curPeer = pTeam[k]; if (curPeer != peer) { // 不能用这个方法:这个方法只有是在客户端往服务器发送请求的时候一对一的匹配返回,不能服务器自动发起 //curPeer.SendOperationResponse(response, sendParameters); // 可以用EventData代替,这个方法回调客户端的:OnEvent()方法 EventData eventData = new EventData(); eventData.Parameters = dic; // 返回操作码 eventData.Code = (byte)OperationCode.ForTeam; curPeer.SendEvent(eventData, new SendParameters()); Helper.Log(curPeer.m_curRole.Name + ":返回队伍信息:" + strRes); } } } else // 找不到组队队友,等待 { // 加入副本对应的队伍申请列表 MyGameApplication.MyInstance.AddTeam(peer.m_strRoomID, peer); response.ReturnCode = (short)ReturnCode.Waitting; Helper.Log(peer.m_curRole.Name + ":等待队伍信息......"); } }
public void OnEndDrag(PointerEventData eventData) { if (curEquip != null) { if (curEquip.Type == ItemType.LongHandle) { ChangeCurrentPos(0, "weapon", curEquip.itemID, eventData); } if (curEquip.Type == ItemType.SwordShield) { ChangeCurrentPos(1, "weaponSS", curEquip.itemID, eventData); } if (curEquip.Type == ItemType.Wand) { ChangeCurrentPos(2, "weaponWand", curEquip.itemID, eventData); } if (curEquip.Type == ItemType.Armor) { #region 防具需要独立写 Transform armorico = package.transform.Find("window/armor/bool/icon"); Transform armorbool = package.transform.Find("window/armor/bool"); if (armorico != null) { if (eventData.pointerCurrentRaycast.gameObject == armorico.gameObject) { armorico.parent = myParent; armorico.localPosition = Vector3.zero; transform.parent = armorbool; transform.localPosition = Vector3.zero; transform.GetComponent <CanvasGroup>().blocksRaycasts = true; HeroManager.Instance.GetCurHeroData().ArmorId = curEquip.itemID; curHeroData = HeroManager.Instance.GetCurHeroData(); HeroManager.Instance.SaveData(UserManager.Instance.GetCurUser().ID, curHeroData.RoleID, curHeroData); return; } } if (eventData.pointerCurrentRaycast.gameObject == armorbool.gameObject) { transform.parent = armorbool; transform.localPosition = Vector3.zero; transform.GetComponent <CanvasGroup>().blocksRaycasts = true; HeroManager.Instance.GetCurHeroData().ArmorId = curEquip.itemID; curHeroData = HeroManager.Instance.GetCurHeroData(); HeroManager.Instance.SaveData(UserManager.Instance.GetCurUser().ID, curHeroData.RoleID, curHeroData); return; } transform.GetComponent <CanvasGroup>().blocksRaycasts = true; transform.parent = myParent; transform.localPosition = Vector3.zero; HeroManager.Instance.SaveData(UserManager.Instance.GetCurUser().ID, curHeroData.RoleID, curHeroData); return; #endregion } } if (curConsumable != null) { if (curConsumable.ID >= 10001 && curConsumable.ID <= 10003) { ChangeCurrentPos(3, "blood", curConsumable.itemID, eventData); } if (curConsumable.ID >= 10004 && curConsumable.ID <= 10006) { ChangeCurrentPos(4, "attack", curConsumable.itemID, eventData); } if (curConsumable.ID >= 10007 && curConsumable.ID <= 10009) { ChangeCurrentPos(5, "speed", curConsumable.itemID, eventData); } } GameObject borderLong = package.transform.Find("window/weapon/Image").gameObject; GameObject borderSS = package.transform.Find("window/weaponSS/Image").gameObject; GameObject borderWand = package.transform.Find("window/weaponWand/Image").gameObject; Equip nowEquip = PackageManager.Instance.GetItem <Equip>(curHeroData.WeaponId); if (nowEquip == null) { borderLong.SetActive(false); borderSS.SetActive(false); borderWand.SetActive(false); } else { if (nowEquip.Type == ItemType.LongHandle) { borderLong.SetActive(true); borderSS.SetActive(false); borderWand.SetActive(false); } if (nowEquip.Type == ItemType.SwordShield) { borderLong.SetActive(false); borderSS.SetActive(true); borderWand.SetActive(false); } if (nowEquip.Type == ItemType.Wand) { borderLong.SetActive(false); borderSS.SetActive(false); borderWand.SetActive(true); } } }
private MembershipManager() { dataUser = new UserData(); dataRole = new RoleData(); }
//测试用 public void InitHeroData() { BattleRoleList.Clear(); RoleData data1 = new RoleData(); data1.baseID = 1; data1.roleType = RoleType.Hero; data1.attackSpeed = 100; data1.hp = 100; data1.attack = 60; data1.maxHp = 100; data1.iconName = "lixiaoyao"; BattleRoleList.Add(data1); RoleData data2 = new RoleData(); data2.baseID = 2; data2.roleType = RoleType.Hero; data2.attackSpeed = 200; data2.hp = 100; data2.attack = 60; data2.maxHp = 100; data2.iconName = "suyao"; BattleRoleList.Add(data2); RoleData data3 = new RoleData(); data3.baseID = 3; data3.roleType = RoleType.Hero; data3.attackSpeed = 300; data3.hp = 100; data3.attack = 60; data3.maxHp = 100; data3.iconName = "suyu"; BattleRoleList.Add(data3); }
public void InitData(RoleData r) { data = r; RolesMgr.Instance.OpenXiLianPop(this); }
public Courtesan(RoleData data, SimDescription s, IRoleGiver roleGiver) : base(data, s, roleGiver) { }
//绘制窗口时调用 void OnGUI() { data = null; GUILayout.BeginArea(new Rect(5, 5, 200, 20)); GUI.Label(new Rect(0, 0, 50, 18), "搜索名称:"); searchKeyword = GUI.TextField(new Rect(55, 0, 100, 18), searchKeyword); if (GUI.Button(new Rect(160, 0, 30, 18), "搜索")) { selGridInt = 0; fetchData(searchKeyword); } GUILayout.EndArea(); GUILayout.BeginArea(new Rect(205, 5, 200, 20)); if (GUI.Button(new Rect(0, 0, 80, 18), "生成对应简表")) { //生成excel Excel outputXls = new Excel(); ExcelTable outputTable = new ExcelTable(); outputTable.TableName = "战斗角色简表"; string outputPath = ExcelEditor.DocsPath + "/战斗角色简表.xlsx"; outputXls.Tables.Add(outputTable); outputXls.Tables[0].SetValue(1, 1, "角色id"); outputXls.Tables[0].SetValue(1, 2, "名称"); outputXls.Tables[0].SetValue(1, 3, "兵器"); outputXls.Tables[0].SetValue(1, 4, "秘籍"); int rowIndex = 2; RoleData role; string booksStr; for (int i = 0, len = allRoleDatas.Count; i < len; i++) { role = allRoleDatas[i]; if (role == null) { continue; } outputXls.Tables[0].SetValue(rowIndex, 1, role.Id); outputXls.Tables[0].SetValue(rowIndex, 2, role.Name); outputXls.Tables[0].SetValue(rowIndex, 3, role.ResourceWeaponDataId); booksStr = ""; for (int j = 0, len2 = role.ResourceBookDataIds.Count; j < len2; j++) { if (j > 0) { booksStr += "|"; } booksStr += role.ResourceBookDataIds[j]; } outputXls.Tables[0].SetValue(rowIndex, 4, booksStr); rowIndex++; } ExcelHelper.SaveExcel(outputXls, outputPath); //生成excel Debug.Log("对应简表创建完毕"); } if (GUI.Button(new Rect(85, 0, 80, 18), "加载角色数据")) { string path = ExcelEditor.DocsPath + "/数值平衡.xlsx"; Excel xls = ExcelHelper.LoadExcel(path); ExcelTable table = xls.Tables[0]; List <string> areaNames = new List <string>() { }; string areaName; RoleData friend; RoleData enemy; for (int i = 1; i <= table.NumberOfRows; i++) { areaName = table.GetValue(i, 1).ToString(); if (!string.IsNullOrEmpty(areaName)) { areaNames.Add(areaName); } else { if (!string.IsNullOrEmpty(table.GetValue(i, 2).ToString())) { if (dataMapping.ContainsKey(table.GetValue(i, 2).ToString())) { friend = dataMapping[table.GetValue(i, 2).ToString()]; friend.IsKnight = true; friend.IsBoss = false; friend.Id = table.GetValue(i, 2).ToString(); friend.Name = table.GetValue(i, 3).ToString(); friend.Lv = int.Parse(table.GetValue(i, 4).ToString()); friend.DifLv4HP = int.Parse(table.GetValue(i, 7).ToString()); friend.DifLv4PhysicsAttack = int.Parse(table.GetValue(i, 9).ToString()); friend.DifLv4PhysicsDefense = int.Parse(table.GetValue(i, 11).ToString()); friend.DifLv4MagicAttack = int.Parse(table.GetValue(i, 13).ToString()); friend.DifLv4MagicDefense = int.Parse(table.GetValue(i, 15).ToString()); friend.DifLv4Dodge = int.Parse(table.GetValue(i, 17).ToString()); friend.Desc = table.GetValue(i, 20).ToString(); //记录武功类型 0为外功 1为内功 //处理兵器秘籍 // if (!string.IsNullOrEmpty(table.GetValue(i, 18).ToString())) { // friend.ResourceWeaponDataId = table.GetValue(i, 18).ToString(); // } // if (!string.IsNullOrEmpty(table.GetValue(i, 19).ToString())) { // string[] fen = table.GetValue(i, 19).ToString().Split(new char[] { '|' }); // friend.ResourceBookDataIds.Clear(); // foreach (string f in fen) { // friend.ResourceBookDataIds.Add(f); // } // } friend.InitAttribute(); Debug.Log(friend.Id + "," + friend.Name); } } if (!string.IsNullOrEmpty(table.GetValue(i, 21).ToString())) { if (dataMapping.ContainsKey(table.GetValue(i, 21).ToString())) { enemy = dataMapping[table.GetValue(i, 21).ToString()]; enemy.IsKnight = false; enemy.IsBoss = table.GetValue(i, 40).ToString() == "是"; enemy.Id = table.GetValue(i, 21).ToString(); enemy.Name = table.GetValue(i, 22).ToString(); enemy.Lv = int.Parse(table.GetValue(i, 23).ToString()); enemy.DifLv4HP = int.Parse(table.GetValue(i, 26).ToString()); enemy.DifLv4PhysicsAttack = int.Parse(table.GetValue(i, 28).ToString()); enemy.DifLv4PhysicsDefense = int.Parse(table.GetValue(i, 30).ToString()); enemy.DifLv4MagicAttack = int.Parse(table.GetValue(i, 32).ToString()); enemy.DifLv4MagicDefense = int.Parse(table.GetValue(i, 34).ToString()); enemy.DifLv4Dodge = int.Parse(table.GetValue(i, 36).ToString()); enemy.Desc = table.GetValue(i, 37).ToString(); //记录武功类型 0为外功 1为内功 // //处理兵器秘籍 // if (!string.IsNullOrEmpty(table.GetValue(i, 38).ToString())) { // enemy.ResourceWeaponDataId = table.GetValue(i, 38).ToString(); // } // if (!string.IsNullOrEmpty(table.GetValue(i, 39).ToString())) { // string[] fen = table.GetValue(i, 39).ToString().Split(new char[] { '|' }); // enemy.ResourceBookDataIds.Clear(); // foreach (string f in fen) { // enemy.ResourceBookDataIds.Add(f); // } // } enemy.InitAttribute(); Debug.Log(enemy.Id + "," + enemy.Name); } } } } writeDataToJson(); oldSelGridInt = -1; getData(); fetchData(searchKeyword); this.ShowNotification(new GUIContent("数据加载成功")); } GUILayout.EndArea(); float listStartX = 5; float listStartY = 25; float scrollHeight = Screen.currentResolution.height - 110; if (listNames != null && listNames.Count > 0) { float contextHeight = listNames.Count * 21; //开始滚动视图 scrollPosition = GUI.BeginScrollView(new Rect(listStartX, listStartY, 200, scrollHeight), scrollPosition, new Rect(5, 5, 190, contextHeight), false, scrollHeight < contextHeight); selGridInt = GUILayout.SelectionGrid(selGridInt, listNames.ToArray(), 1, GUILayout.Width(190)); selGridInt = selGridInt >= listNames.Count ? listNames.Count - 1 : selGridInt; data = showListData[selGridInt]; if (selGridInt != oldSelGridInt) { oldSelGridInt = selGridInt; showId = data.Id; roleName = data.Name; if (iconIdIndexs.ContainsKey(data.IconId)) { iconIndex = iconIdIndexs[data.IconId]; } else { iconIndex = 0; } if (iconTextureMappings.ContainsKey(data.IconId)) { iconTexture = iconTextureMappings[data.IconId]; } else { iconTexture = null; } occupationTypeIndex = occupationTypeIndexMapping[data.Occupation]; genderTypeIndex = genderTypeIndexMapping[data.Gender]; if (halfBodyIdIndexs.ContainsKey(data.HalfBodyId)) { halfBodyIdIndex = halfBodyIdIndexs[data.HalfBodyId]; } else { halfBodyIdIndex = 0; } if (halfBodyTextureMappings.ContainsKey(data.HalfBodyId)) { halfBodyTexture = halfBodyTextureMappings[data.HalfBodyId]; } else { halfBodyTexture = null; } // data.InitAttribute(); roleDesc = data.Desc; hp = data.HP; maxHp = data.MaxHP; physicsAttack = data.PhysicsAttack; physicsDefense = data.PhysicsDefense; magicAttack = data.MagicAttack; magicDefense = data.MagicDefense; attackSpeed = data.AttackSpeed; dodge = data.Dodge; lv = data.Lv; difLv4HP = data.DifLv4HP; difLv4PhysicsAttack = data.DifLv4PhysicsAttack; difLv4PhysicsDefense = data.DifLv4PhysicsDefense; difLv4MagicAttack = data.DifLv4MagicAttack; difLv4MagicDefense = data.DifLv4MagicDefense; difLv4Dodge = data.DifLv4Dodge; bookDataIdIndexes = new List <int>(); string bookId; for (int i = 0; i < 3; i++) { bookId = data.ResourceBookDataIds.Count > i ? data.ResourceBookDataIds[i] : ""; bookDataIdIndexes.Add(bookIdIndexs.ContainsKey(bookId) ? bookIdIndexs[bookId] : 0); } if (weaponIdIndexs.ContainsKey(data.ResourceWeaponDataId)) { weaponDataIdIndex = weaponIdIndexs[data.ResourceWeaponDataId]; } else { weaponDataIdIndex = 0; } effectSoundIdIndex = soundIdIndexs.ContainsKey(data.DeadSoundId) ? soundIdIndexs[data.DeadSoundId] : 0; isImmuneMaxHPReduce = data.IsImmuneMaxHPReduce; isStatic = data.IsStatic; isKnight = data.IsKnight; isBoss = data.IsBoss; showId = data.Id; data.HometownCityId = data.HometownCityId == null ? "" : data.HometownCityId; homedownCityIdIndex = allCitySceneIdIndexs.ContainsKey(data.HometownCityId) ? allCitySceneIdIndexs[data.HometownCityId] : 0; } //结束滚动视图 GUI.EndScrollView(); if (data != null) { GUILayout.BeginArea(new Rect(listStartX + 205, listStartY, 800, 555)); if (iconTexture != null) { GUI.DrawTexture(new Rect(0, 0, 50, 50), iconTexture); } GUI.Label(new Rect(55, 0, 40, 18), "Id:"); showId = EditorGUI.TextField(new Rect(100, 0, 100, 18), showId); GUI.Label(new Rect(205, 0, 40, 18), "姓名:"); roleName = EditorGUI.TextField(new Rect(250, 0, 100, 18), roleName); GUI.Label(new Rect(355, 0, 40, 18), "性别:"); genderTypeIndex = EditorGUI.Popup(new Rect(400, 0, 100, 18), genderTypeIndex, genderTypeStrs.ToArray()); GUI.Label(new Rect(55, 20, 40, 18), "Icon:"); iconIndex = EditorGUI.Popup(new Rect(100, 20, 100, 18), iconIndex, iconNames.ToArray()); GUI.Label(new Rect(205, 20, 40, 18), "门派:"); occupationTypeIndex = EditorGUI.Popup(new Rect(250, 20, 100, 18), occupationTypeIndex, occupationTypeStrs.ToArray()); GUI.Label(new Rect(355, 20, 40, 18), "半身像:"); halfBodyIdIndex = EditorGUI.Popup(new Rect(400, 20, 100, 18), halfBodyIdIndex, halfBodyNames.ToArray()); GUI.Label(new Rect(55, 40, 40, 18), "描述:"); roleDesc = GUI.TextArea(new Rect(100, 40, 400, 60), roleDesc); GUI.Label(new Rect(55, 105, 50, 18), "气血:"); EditorGUI.Slider(new Rect(100, 105, 165, 18), hp, 1, 1000000); GUI.Label(new Rect(270, 105, 50, 18), "气血上限:"); EditorGUI.Slider(new Rect(335, 105, 165, 18), maxHp, 1, 1000000); GUI.Label(new Rect(55, 125, 50, 18), "外功:"); EditorGUI.Slider(new Rect(100, 125, 165, 18), physicsAttack, 0, 100000); GUI.Label(new Rect(270, 125, 50, 18), "外防:"); EditorGUI.Slider(new Rect(335, 125, 165, 18), physicsDefense, 0, 1000000); GUI.Label(new Rect(55, 145, 50, 18), "内功:"); EditorGUI.Slider(new Rect(100, 145, 165, 18), magicAttack, 0, 100000); GUI.Label(new Rect(270, 145, 50, 18), "内防:"); EditorGUI.Slider(new Rect(335, 145, 165, 18), magicDefense, 0, 1000000); GUI.Label(new Rect(55, 165, 50, 18), "攻速:"); attackSpeed = EditorGUI.Slider(new Rect(100, 165, 165, 18), attackSpeed, 0, 50); GUI.Label(new Rect(270, 165, 50, 18), "轻功:"); EditorGUI.Slider(new Rect(335, 165, 165, 18), dodge, 0, 200); GUI.Label(new Rect(55, 185, 50, 18), "秘籍:"); bookDataIdIndexes[0] = EditorGUI.Popup(new Rect(110, 185, 100, 18), bookDataIdIndexes[0], bookNames.ToArray()); bookDataIdIndexes[1] = EditorGUI.Popup(new Rect(215, 185, 100, 18), bookDataIdIndexes[1], bookNames.ToArray()); bookDataIdIndexes[2] = EditorGUI.Popup(new Rect(320, 185, 100, 18), bookDataIdIndexes[2], bookNames.ToArray()); GUI.Label(new Rect(55, 205, 50, 18), "兵器:"); weaponDataIdIndex = EditorGUI.Popup(new Rect(110, 205, 100, 18), weaponDataIdIndex, weaponNames.ToArray()); GUI.Label(new Rect(215, 205, 50, 18), "音效:"); effectSoundIdIndex = EditorGUI.Popup(new Rect(270, 205, 100, 18), effectSoundIdIndex, soundNames.ToArray()); GUI.Label(new Rect(215, 225, 100, 18), "免疫气血上限衰减:"); isImmuneMaxHPReduce = EditorGUI.Toggle(new Rect(320, 225, 20, 18), isImmuneMaxHPReduce); GUI.Label(new Rect(375, 205, 50, 18), "静态:"); isStatic = EditorGUI.Toggle(new Rect(405, 205, 20, 18), isStatic); GUI.Label(new Rect(440, 205, 50, 18), "侠客:"); isKnight = EditorGUI.Toggle(new Rect(470, 205, 20, 18), isKnight); GUI.Label(new Rect(375, 225, 50, 18), "Boss:"); isBoss = EditorGUI.Toggle(new Rect(405, 225, 20, 18), isBoss); GUI.Label(new Rect(55, 225, 50, 18), "故乡:"); homedownCityIdIndex = EditorGUI.Popup(new Rect(110, 225, 100, 18), homedownCityIdIndex, allCitySceneNames.ToArray()); if (halfBodyTexture != null) { GUI.DrawTexture(new Rect(505, 0, 325, 260), halfBodyTexture); } if (oldIconIndex != iconIndex) { oldIconIndex = iconIndex; iconTexture = iconTextureMappings[icons[iconIndex].Id]; } GUI.Label(new Rect(55, 245, 50, 18), "等级:"); try { lv = Mathf.Clamp(int.Parse(EditorGUI.TextField(new Rect(110, 245, 40, 18), lv.ToString())), 1, 120); } catch (Exception e) { lv = 1; } GUI.Label(new Rect(155, 245, 50, 18), "气血差量:"); try { difLv4HP = Mathf.Clamp(int.Parse(EditorGUI.TextField(new Rect(205, 245, 40, 18), difLv4HP.ToString())), -1000, 1000); } catch (Exception e) { difLv4HP = 0; } GUI.Label(new Rect(250, 245, 50, 18), "外功差量:"); try { difLv4PhysicsAttack = Mathf.Clamp(int.Parse(EditorGUI.TextField(new Rect(305, 245, 40, 18), difLv4PhysicsAttack.ToString())), -1000, 1000); } catch (Exception e) { difLv4PhysicsAttack = 0; } GUI.Label(new Rect(350, 245, 50, 18), "外防差量:"); try { difLv4PhysicsDefense = Mathf.Clamp(int.Parse(EditorGUI.TextField(new Rect(405, 245, 40, 18), difLv4PhysicsDefense.ToString())), -5000, 5000); } catch (Exception e) { difLv4PhysicsDefense = 0; } GUI.Label(new Rect(155, 265, 50, 18), "轻功差量:"); try { difLv4Dodge = Mathf.Clamp(int.Parse(EditorGUI.TextField(new Rect(205, 265, 40, 18), difLv4Dodge.ToString())), -200, 200); } catch (Exception e) { difLv4Dodge = 0; } GUI.Label(new Rect(250, 265, 50, 18), "内功差量:"); try { difLv4MagicAttack = Mathf.Clamp(int.Parse(EditorGUI.TextField(new Rect(305, 265, 40, 18), difLv4MagicAttack.ToString())), -1000, 1000); } catch (Exception e) { difLv4MagicAttack = 0; } GUI.Label(new Rect(350, 265, 50, 18), "内防差量:"); try { difLv4MagicDefense = Mathf.Clamp(int.Parse(EditorGUI.TextField(new Rect(405, 265, 40, 18), difLv4MagicDefense.ToString())), -5000, 5000); } catch (Exception e) { difLv4MagicDefense = 0; } if (GUI.Button(new Rect(0, 295, 80, 18), "修改基础属性")) { if (roleName == "") { this.ShowNotification(new GUIContent("招式名不能为空!")); return; } data.Id = showId; data.Name = roleName; data.IconId = icons[iconIndex].Id; data.Occupation = occupationTypeEnums[occupationTypeIndex]; data.Gender = genderTypeEnums[genderTypeIndex]; data.HalfBodyId = halfBodys[halfBodyIdIndex].Id; data.Desc = roleDesc; data.HP = hp; data.MaxHP = maxHp; data.PhysicsAttack = physicsAttack; data.PhysicsDefense = physicsDefense; data.MagicAttack = magicAttack; data.MagicDefense = magicDefense; data.Dodge = dodge; data.AttackSpeed = attackSpeed; data.Lv = lv; data.DifLv4HP = difLv4HP; data.DifLv4PhysicsAttack = difLv4PhysicsAttack; data.DifLv4PhysicsDefense = difLv4PhysicsDefense; data.DifLv4MagicAttack = difLv4MagicAttack; data.DifLv4MagicDefense = difLv4MagicDefense; data.DifLv4Dodge = difLv4Dodge; data.HometownCityId = allCityScenes[homedownCityIdIndex].Id; data.ResourceBookDataIds.Clear(); foreach (int bookIdIndex in bookDataIdIndexes) { if (bookIdIndex > 0) { if (books[bookIdIndex].Occupation == OccupationType.None || books[bookIdIndex].Occupation == data.Occupation) { if (books[bookIdIndex].LimitWeaponType == WeaponType.None || weapons[weaponDataIdIndex].Type == WeaponType.None || books[bookIdIndex].LimitWeaponType == weapons[weaponDataIdIndex].Type) { data.ResourceBookDataIds.Add(books[bookIdIndex].Id); } else { this.ShowNotification(new GUIContent(string.Format("装备{0}后不能再习练{1},兵器类型不符!", weapons[weaponDataIdIndex].Name, books[bookIdIndex].Name))); return; } } else { this.ShowNotification(new GUIContent(string.Format("秘籍{0}无法装备到{1}身上,门派不符!", books[bookIdIndex].Name, data.Name))); return; } } } if (weapons[weaponDataIdIndex].Occupation == OccupationType.None || weapons[weaponDataIdIndex].Occupation == data.Occupation) { data.ResourceWeaponDataId = weapons[weaponDataIdIndex].Id; } else { this.ShowNotification(new GUIContent(string.Format("兵器{0}无法装备到{1}身上,门派不符!", weapons[weaponDataIdIndex].Name, data.Name))); return; } data.DeadSoundId = sounds[effectSoundIdIndex].Id; data.IsImmuneMaxHPReduce = isImmuneMaxHPReduce; data.IsStatic = isStatic; data.IsKnight = isKnight; data.IsBoss = isBoss; data.InitAttribute(); writeDataToJson(); oldSelGridInt = -1; getData(); fetchData(searchKeyword); this.ShowNotification(new GUIContent("修改成功")); } GUILayout.EndArea(); } } GUILayout.BeginArea(new Rect(listStartX + 205, listStartY + 320, 300, 60)); switch (toolState) { case 0: if (GUI.Button(new Rect(0, 0, 80, 18), "添加")) { toolState = 1; } if (GUI.Button(new Rect(85, 0, 80, 18), "删除")) { toolState = 2; } break; case 1: GUI.Label(new Rect(0, 0, 30, 18), "Id:"); addId = EditorGUI.TextField(new Rect(35, 0, 100, 18), addId); GUI.Label(new Rect(140, 0, 60, 18), "角色名:"); addRoleName = EditorGUI.TextField(new Rect(205, 0, 100, 18), addRoleName); if (GUI.Button(new Rect(0, 20, 60, 18), "确定添加")) { toolState = 0; if (addId == "") { this.ShowNotification(new GUIContent("Id不能为空!")); return; } if (addRoleName == "") { this.ShowNotification(new GUIContent("角色姓名不能为空!")); return; } if (dataMapping.ContainsKey(addId)) { this.ShowNotification(new GUIContent("Id重复!")); return; } RoleData addRoleData = new RoleData(); addRoleData.Id = addId; addRoleData.Name = addRoleName; ResourceSrcData findIcon = icons.Find(item => item.Name.IndexOf(addRoleData.Name) >= 0); if (findIcon != null) { addRoleData.IconId = findIcon.Id; } ResourceSrcData findHalfBodyIcon = halfBodys.Find(item => item.Name.IndexOf(addRoleData.Name) >= 0); if (findHalfBodyIcon != null) { addRoleData.HalfBodyId = findHalfBodyIcon.Id; } dataMapping.Add(addId, addRoleData); writeDataToJson(); addedId = addId; getData(); fetchData(searchKeyword); // addId = ""; addRoleName = ""; this.ShowNotification(new GUIContent("添加成功")); } if (GUI.Button(new Rect(65, 20, 60, 18), "取消")) { toolState = 0; } break; case 2: if (GUI.Button(new Rect(0, 0, 60, 18), "确定删除")) { toolState = 0; if (!dataMapping.ContainsKey(data.Id)) { this.ShowNotification(new GUIContent("待删除的数据不存在!")); return; } dataMapping.Remove(data.Id); writeDataToJson(); selGridInt = 0; oldSelGridInt = -1; getData(); fetchData(searchKeyword); this.ShowNotification(new GUIContent("删除成功")); } if (GUI.Button(new Rect(65, 0, 60, 18), "取消")) { toolState = 0; } break; default: break; } GUILayout.EndArea(); }
public void InitData(RoleData d) { role.spriteName = d.icon; data = d; //ListenOnClick(this.gameObject, ClickRole); }
public List <ExtendedGroupMembersData> GetGroupMembers(string RequestingAgentID, UUID GroupID) { List <ExtendedGroupMembersData> members = new List <ExtendedGroupMembersData>(); GroupData group = m_Database.RetrieveGroup(GroupID); if (group == null) { return(members); } // Unfortunately this doesn't quite work on legacy group data because of a bug // that's also being fixed here on CreateGroup. The OwnerRoleID sent to the DB was wrong. // See how to find the ownerRoleID a few lines below. UUID ownerRoleID = new UUID(group.Data["OwnerRoleID"]); RoleData[] roles = m_Database.RetrieveRoles(GroupID); if (roles == null) { // something wrong with this group return(members); } List <RoleData> rolesList = new List <RoleData>(roles); // Let's find the "real" ownerRoleID RoleData ownerRole = rolesList.Find(r => r.Data["Powers"] == ((long)OwnerPowers).ToString()); if (ownerRole != null) { ownerRoleID = ownerRole.RoleID; } // Check visibility? // When we don't want to check visibility, we pass it "all" as the requestingAgentID bool checkVisibility = !RequestingAgentID.Equals(UUID.Zero.ToString()); if (checkVisibility) { // Is the requester a member of the group? bool isInGroup = false; if (m_Database.RetrieveMember(GroupID, RequestingAgentID) != null) { isInGroup = true; } if (!isInGroup) // reduce the roles to the visible ones { rolesList = rolesList.FindAll(r => (UInt64.Parse(r.Data["Powers"]) & (ulong)GroupPowers.MemberVisible) != 0); } } MembershipData[] datas = m_Database.RetrieveMembers(GroupID); if (datas == null || (datas != null && datas.Length == 0)) { return(members); } // OK, we have everything we need foreach (MembershipData d in datas) { RoleMembershipData[] rolememberships = m_Database.RetrieveMemberRoles(GroupID, d.PrincipalID); List <RoleMembershipData> rolemembershipsList = new List <RoleMembershipData>(rolememberships); ExtendedGroupMembersData m = new ExtendedGroupMembersData(); // What's this person's current role in the group? UUID selectedRole = new UUID(d.Data["SelectedRoleID"]); RoleData selected = rolesList.Find(r => r.RoleID == selectedRole); if (selected != null) { m.Title = selected.Data["Title"]; m.AgentPowers = UInt64.Parse(selected.Data["Powers"]); } m.AgentID = d.PrincipalID; m.AcceptNotices = d.Data["AcceptNotices"] == "1" ? true : false; m.Contribution = Int32.Parse(d.Data["Contribution"]); m.ListInProfile = d.Data["ListInProfile"] == "1" ? true : false; GridUserData gud = m_GridUserService.Get(d.PrincipalID); if (gud != null) { if (bool.Parse(gud.Data["Online"])) { m.OnlineStatus = @"Online"; } else { int unixtime = int.Parse(gud.Data["Login"]); // The viewer is very picky about how these strings are formed. Eg. it will crash on malformed dates! m.OnlineStatus = (unixtime == 0) ? @"unknown" : Util.ToDateTime(unixtime).ToString("MM/dd/yyyy"); } } // Is this person an owner of the group? m.IsOwner = (rolemembershipsList.Find(r => r.RoleID == ownerRoleID) != null) ? true : false; members.Add(m); } return(members); }
public void RoleListCallback(C2sSprotoType.role_all.response resp) { RoleData temp = null; for (int i = 0; i < resp.l.Count; i++) { RoleData r = GameShared.Instance.GetRoleById((int)resp.l[i].csv_id); r.is_possessed = resp.l[i].is_possessed; r.wakeLevel = (int)resp.l[i].star; if (r.is_possessed) { r.xilianList = new List <XiLianData>(); Debug.Log("resp.l[i].property_id1" + resp.l[i].property_id1 + "resp.l[i].value1" + resp.l[i].value1); if (resp.l[i].property_id1 != 0) { r.xilianList.Add(this.InitXiLianData((Def.AttrId)resp.l[i].property_id1, (int)resp.l[i].value1)); } if (resp.l[i].property_id2 != 0) { r.xilianList.Add(this.InitXiLianData((Def.AttrId)resp.l[i].property_id2, (int)resp.l[i].value2)); } if (resp.l[i].property_id3 != 0) { r.xilianList.Add(this.InitXiLianData((Def.AttrId)resp.l[i].property_id3, (int)resp.l[i].value3)); } if (resp.l[i].property_id4 != 0) { r.xilianList.Add(this.InitXiLianData((Def.AttrId)resp.l[i].property_id4, (int)resp.l[i].value4)); } if (resp.l[i].property_id5 != 0) { r.xilianList.Add(this.InitXiLianData((Def.AttrId)resp.l[i].property_id5, (int)resp.l[i].value5)); } } int id = (r.csv_id * 1000) + r.wakeLevel; r.sort = GetSort(r); Debug.Log(r.sort + "/" + (int)r.csv_id); r.starData = GameShared.Instance.GetRoleStarById(id); r.frgNum = (int)resp.l[i].u_us_prop_num; if (UserManager.Instance.RoleTable.Contains(r.csv_id)) { UserManager.Instance.RoleTable[r.csv_id] = r; } else { UserManager.Instance.RoleTable.Add(r.csv_id, r); } if (temp != null && r.sort < temp.sort) { temp = r; } if (temp == null) { temp = r; } } System.Collections.IDictionaryEnumerator enumerator = UserManager.Instance.RoleTable.GetEnumerator(); while (enumerator.MoveNext()) { RoleData r = UserManager.Instance.RoleTable[enumerator.Key] as RoleData; r.sort = GetSort(r); } //LuaFunction f = l.GetFunction("RoleListCallback"); //object[] obj = f.Call(list); pop.SetTable(ref UserManager.Instance.RoleTable); pop.SetCurView(pop.GetItemView(temp.sort)); SetInfo(); CheckBtn(); if (UserManager.Instance.RoleTable != null && UserManager.Instance.RoleTable.Count > 0) { SetRoleInfo(ref pop.GetItemView(temp.sort).data); } }
public void Run(string environmentName) { // Role foreach (var item in _roleManager.Roles.ToList()) { var deleteIdentityResult = _roleManager.DeleteAsync(item).Result; if (!deleteIdentityResult.Succeeded) { throw new Exception($"Can't delete role: {item.Name}. Description '{deleteIdentityResult.Errors.Select(x => x.Description).FirstOrDefault()}'"); } } foreach (var item in RoleData.GetList(environmentName)) { var createIdentityResult = _roleManager.CreateAsync(item.Role).Result; if (!createIdentityResult.Succeeded) { throw new Exception($"Can't create user: {item.Role.Name}. Description '{createIdentityResult.Errors.Select(x => x.Description).FirstOrDefault()}'"); } foreach (var roleClaim in item.RoleClaims) { var addClaimIdentityResult = _roleManager.AddClaimAsync(item.Role, new Claim(roleClaim.ClaimType, roleClaim.ClaimValue)).Result; if (!addClaimIdentityResult.Succeeded) { throw new Exception($"Can't add claim to role: {item.Role.Name}. Description '{addClaimIdentityResult.Errors.Select(x => x.Description).FirstOrDefault()}'"); } } } // User foreach (var item in _userManager.Users.ToList()) { var deleteIdentityResult = _userManager.DeleteAsync(item).Result; if (!deleteIdentityResult.Succeeded) { throw new Exception($"Can't delete user: {item.Email}. Description '{deleteIdentityResult.Errors.Select(x => x.Description).FirstOrDefault()}'"); } } foreach (var item in UserData.GetList(environmentName)) { var createIdentityResult = _userManager.CreateAsync(item.User, item.Password).Result; if (!createIdentityResult.Succeeded) { throw new Exception($"Can't create user: {item.User.Email}. Description '{createIdentityResult.Errors.Select(x => x.Description).FirstOrDefault()}'"); } if (item.Roles != null) { var addToRolesIdentityResult = _userManager.AddToRolesAsync(item.User, item.Roles).Result; if (!addToRolesIdentityResult.Succeeded) { throw new Exception($"Can't add user: {item.User.Email} to roles. Description '{addToRolesIdentityResult.Errors.Select(x => x.Description).FirstOrDefault()}'"); } } } }
public void SetRoleInfo(ref RoleData d) { float c = 0; float cu = 0; int index = 0; d.frgNum = BagMgr.Instance.GetItemNumById(d.starData.us_prop_csv_id); for (int i = 0; i < pop.GetCurView().data.starData.additionArr.Length; i++) { c = GetRoleCollectAttrByType(i); cu = GetCollectRoleUPAttrByType(i); if (c > 0) { index = i; break; } } string desc = GetAttrStr((Def.AttrId)index); pop.SetCollectDesc(desc); if (d.is_possessed == false) { int id = (d.starData.csv_id * 1000) + 5; RoleStarData r = GameShared.Instance.GetRoleStarById(id); float a = d.frgNum / (float)d.starData.us_prop_num; pop.SetRoleInfo(d, (int)r.battleAddition[(int)Def.AttrType.FightPower] + "%满级", (int)c + "%满级", "", "", (int)a, d.frgNum + "/" + d.starData.us_prop_num ); pop.SetArrowShow(false); } else if (d.wakeLevel >= Def.WakeLevelMax) { float a = d.frgNum / (float)d.starData.us_prop_num; pop.SetRoleInfo(d, (int)GetRoleBattleAttrByType((int)Def.AttrType.FightPower) + "%满级", (int)c + "%满级", "", "", (int)a, d.frgNum + "/" + d.starData.us_prop_num ); pop.SetArrowShow(false); } else { int id = d.starData.g_csv_id + 1; RoleStarData r = GameShared.Instance.GetRoleStarById(id); float a = d.frgNum / (float)r.us_prop_num; pop.SetRoleInfo(d, (int)GetRoleBattleAttrByType((int)Def.AttrType.FightPower) + "%", (int)c + "%", (int)GetBattleRoleUPAttrByType((int)Def.AttrType.FightPower) + "%", (int)cu + "%", (int)a, d.frgNum + "/" + r.us_prop_num ); pop.SetArrowShow(true); } string[] s = d.starData.strs.Split('*'); pop.SetTalk(s[0]); }
public virtual IEnumerable <SpecialtyInfo> GetSpecialties(RoleData roleData, int?hospitalId) { return(_trustApplicationService.GetSpecialties(hospitalId)); }
public IEnumerable <RuleViolationViewModel> GetRuleViolations([ModelBinder(typeof(RoleDataModelBinder))] RoleData role) { return(_notificationPresentationService.GetRuleViolations(role)); }
private void onReceiveRole(RoleData roleData) { image.sprite = Resources.Load <Sprite>("Portraits/" + roleData.id); }
public static void LoadBindingConfigFromRoleMap(params Type[] roleTypeFilter) { var roleDataList = ListPool <RoleData> .Get(); var filterUsed = roleTypeFilter != null && roleTypeFilter.Length > 0; if (filterUsed) { roleDataList.AddRange(s_bindingConfig.roles); } for (int i = 0, imax = ViveRoleEnum.ValidViveRoleTable.Count; i < imax; ++i) { var roleType = ViveRoleEnum.ValidViveRoleTable.GetValueByIndex(i); var roleName = ViveRoleEnum.ValidViveRoleTable.GetKeyByIndex(i); var roleMap = ViveRole.GetMap(roleType); if (filterUsed) { // apply filter var filtered = false; foreach (var t in roleTypeFilter) { if (roleType == t) { filtered = true; break; } } if (!filtered) { continue; } } if (roleMap.BindingCount > 0) { var bindingTable = roleMap.BindingTable; var roleData = new RoleData() { type = roleName, bindings = new Binding[bindingTable.Count], }; for (int j = 0, jmax = bindingTable.Count; j < jmax; ++j) { var binding = new Binding(); binding.device_sn = bindingTable.GetKeyByIndex(j); binding.role_value = bindingTable.GetValueByIndex(j); binding.role_name = roleMap.RoleValueInfo.GetNameByRoleValue(binding.role_value); // save the device_model for better recognition of the device if (VRModule.IsDeviceConnected(binding.device_sn)) { binding.device_model = VRModule.GetCurrentDeviceState(VRModule.GetConnectedDeviceIndex(binding.device_sn)).deviceModel; s_modelHintTable[binding.device_sn] = binding.device_model; } else if (!s_modelHintTable.TryGetValue(binding.device_sn, out binding.device_model)) { binding.device_model = VRModuleDeviceModel.Unknown; } roleData.bindings[j] = binding; } if (filterUsed) { // merge with existing role data var roleDataIndex = roleDataList.FindIndex((item) => item.type == roleName); if (roleDataIndex >= 0) { roleDataList[roleDataIndex] = roleData; } else { roleDataList.Add(roleData); } } else { roleDataList.Add(roleData); } } else { if (roleDataList.Count > 0) { // don't write to config if no bindings roleDataList.RemoveAll((item) => item.type == roleName); } } } s_bindingConfig.roles = roleDataList.ToArray(); ListPool <RoleData> .Release(roleDataList); }
/// <summary> /// 將Json資料寫入字典裡 /// </summary> static void LoadJsonDataToDic() { //文字字典 String_AttributeDic = new Dictionary <string, String_AttributeData>(); String_AttributeData.SetData(String_AttributeDic); //Sprite字典 SpriteDic = new Dictionary <string, SpriteData>(); SpriteData.SetData(SpriteDic); //被動施法 PSpellDic = new Dictionary <int, PassiveSpellData>(); PassiveSpellData.SetData(PSpellDic); //主動施法 ASpellDic = new Dictionary <int, ActivitySpellData>(); ActivitySpellData.SetData(ASpellDic); DamageDic = new Dictionary <int, DamageData>(); DamageData.SetData(DamageDic); CureDic = new Dictionary <int, CureData>(); CureData.SetData(CureDic); BufferDic = new Dictionary <int, BufferData>(); BufferData.SetData(BufferDic); //天賦字典 TalentDic = new Dictionary <int, TalentData>(); TalentData.SetData(TalentDic); //武器 WeaponDic = new Dictionary <int, WeaponData>(); WeaponData.SetData(WeaponDic); //防具 ArmorDic = new Dictionary <int, ArmorData>(); ArmorData.SetData(ArmorDic); //裝備 ProtectorDic = new Dictionary <int, ProtectorData>(); ProtectorData.SetData(ProtectorDic); //裝備 DropDic = new Dictionary <int, DropData>(); DropData.SetData(DropDic); //冒險 AdventureDic = new Dictionary <int, AdventureData>(); AdventureData.SetData(AdventureDic); //出怪事件 MonsterEventDic = new Dictionary <int, MonsterEventData>(); MonsterEventData.SetData(MonsterEventDic); //調查事件 InvestigateEventDic = new Dictionary <int, List <InvestigateEventData> >(); InvestigateEventData.SetData(InvestigateEventDic); //意外事件 AccidentEventDic = new Dictionary <int, List <AccidentEventData> >(); AccidentEventData.SetData(AccidentEventDic); //結果事件 EventResultDic = new Dictionary <int, EventResultData>(); EventResultData.SetData(EventResultDic); //紮營事件 CampDic = new Dictionary <int, List <CampEventData> >(); CampEventData.SetData(CampDic); //怪物 MonsterGroupDic = new Dictionary <int, List <MonsterData> >(); MonsterDic = new Dictionary <int, MonsterData>(); MonsterData.SetData(MonsterGroupDic, MonsterDic); //腳色字典 RoleDic = new Dictionary <int, RoleData>(); RoleData.SetData(RoleDic); //主屬性字典 MainAttributeDic = new Dictionary <MainAttribute, MainAttributeData>(); MainAttributeData.SetData(MainAttributeDic); //等級字典 LevelDic = new Dictionary <int, LevelData>(); LevelData.SetData(LevelDic); }
/// <summary> /// 取得仅更新的SQL语句 /// </summary> internal string GetModifiedSqlCode(RoleData data) { if (data.__EntityStatusNull || !data.__EntityStatus.IsModified) { return(";"); } StringBuilder sql = new StringBuilder(); sql.AppendLine("UPDATE `tb_sys_role` SET"); //角色 if (data.__EntityStatus.ModifiedProperties[RoleData.Real_Role] > 0) { sql.AppendLine(" `role` = ?Role"); } //标题 if (data.__EntityStatus.ModifiedProperties[RoleData.Real_Caption] > 0) { sql.AppendLine(" `caption` = ?Caption"); } //备注 if (data.__EntityStatus.ModifiedProperties[RoleData.Real_Memo] > 0) { sql.AppendLine(" `memo` = ?Memo"); } //数据状态 if (data.__EntityStatus.ModifiedProperties[RoleData.Real_DataState] > 0) { sql.AppendLine(" `data_state` = ?DataState"); } //数据是否已冻结 if (data.__EntityStatus.ModifiedProperties[RoleData.Real_IsFreeze] > 0) { sql.AppendLine(" `is_freeze` = ?IsFreeze"); } //制作人 if (data.__EntityStatus.ModifiedProperties[RoleData.Real_AuthorID] > 0) { sql.AppendLine(" `author_id` = ?AuthorID"); } //制作时间 if (data.__EntityStatus.ModifiedProperties[RoleData.Real_AddDate] > 0) { sql.AppendLine(" `add_date` = ?AddDate"); } //最后修改者 if (data.__EntityStatus.ModifiedProperties[RoleData.Real_LastReviserID] > 0) { sql.AppendLine(" `last_reviser_id` = ?LastReviserID"); } //最后修改日期 if (data.__EntityStatus.ModifiedProperties[RoleData.Real_LastModifyDate] > 0) { sql.AppendLine(" `last_modify_date` = ?LastModifyDate"); } //审核状态 if (data.__EntityStatus.ModifiedProperties[RoleData.Real_AuditState] > 0) { sql.AppendLine(" `audit_state` = ?AuditState"); } //审核人 if (data.__EntityStatus.ModifiedProperties[RoleData.Real_AuditorId] > 0) { sql.AppendLine(" `auditor_id` = ?AuditorId"); } //审核时间 if (data.__EntityStatus.ModifiedProperties[RoleData.Real_AuditDate] > 0) { sql.AppendLine(" `audit_date` = ?AuditDate"); } sql.Append(" WHERE `id` = ?Id;"); return(sql.ToString()); }
public void SetRoleData(RoleData roleData) { RoleData = roleData; RoleTokenImage.sprite = RoleData.RoleTokenSprite; }
/// <summary> /// 设置更新数据的命令 /// </summary> /// <param name="entity">实体对象</param> /// <param name="cmd">命令</param> protected sealed override void SetUpdateCommand(RoleData entity, MySqlCommand cmd) { cmd.CommandText = UpdateSqlCode; CreateFullSqlParameter(entity, cmd); }
public bool StoreRole(RoleData data) { return(m_Roles.Store(data)); }
/// <summary> /// Initializes a new instance of the <see cref="RoleController"/> class. /// </summary> /// <param name="connectionString">The connection string.</param> public RoleController(string connectionString) { _roleData = new RoleData(connectionString); }
public List <ExtendedGroupMembersData> GetGroupMembers(string RequestingAgentID, UUID GroupID) { List <ExtendedGroupMembersData> members = new List <ExtendedGroupMembersData>(); GroupData group = m_Database.RetrieveGroup(GroupID); if (group == null) { return(members); } UUID ownerRoleID = new UUID(group.Data["OwnerRoleID"]); RoleData[] roles = m_Database.RetrieveRoles(GroupID); if (roles == null) { // something wrong with this group return(members); } List <RoleData> rolesList = new List <RoleData>(roles); // Check visibility? // When we don't want to check visibility, we pass it "all" as the requestingAgentID bool checkVisibility = !RequestingAgentID.Equals(UUID.Zero.ToString()); if (checkVisibility) { // Is the requester a member of the group? bool isInGroup = false; if (m_Database.RetrieveMember(GroupID, RequestingAgentID) != null) { isInGroup = true; } if (!isInGroup) // reduce the roles to the visible ones { rolesList = rolesList.FindAll(r => (UInt64.Parse(r.Data["Powers"]) & (ulong)GroupPowers.MemberVisible) != 0); } } MembershipData[] datas = m_Database.RetrieveMembers(GroupID); if (datas == null || (datas != null && datas.Length == 0)) { return(members); } // OK, we have everything we need foreach (MembershipData d in datas) { RoleMembershipData[] rolememberships = m_Database.RetrieveMemberRoles(GroupID, d.PrincipalID); List <RoleMembershipData> rolemembershipsList = new List <RoleMembershipData>(rolememberships); ExtendedGroupMembersData m = new ExtendedGroupMembersData(); // What's this person's current role in the group? UUID selectedRole = new UUID(d.Data["SelectedRoleID"]); RoleData selected = rolesList.Find(r => r.RoleID == selectedRole); if (selected != null) { m.Title = selected.Data["Title"]; m.AgentPowers = UInt64.Parse(selected.Data["Powers"]); m.AgentID = d.PrincipalID; m.AcceptNotices = d.Data["AcceptNotices"] == "1" ? true : false; m.Contribution = Int32.Parse(d.Data["Contribution"]); m.ListInProfile = d.Data["ListInProfile"] == "1" ? true : false; // Is this person an owner of the group? m.IsOwner = (rolemembershipsList.Find(r => r.RoleID == ownerRoleID) != null) ? true : false; members.Add(m); } } return(members); }
/// <summary> /// Appends the role. /// </summary> /// <param name="roleData">Role data.</param> public void AppendRole(RoleData roleData) { RemoveRole(roleData.Id); if (!roleSpritePrefabs.ContainsKey(roleData.SpriteSrc)) { roleSpritePrefabs[roleData.SpriteSrc] = Statics.GetPrefab(roleData.SpriteSrc); } GameObject role = Statics.GetPrefabClone(roleSpritePrefabs[roleData.SpriteSrc]); if (role != null) { RoleCtrl ctrl = role.GetComponent<RoleCtrl>(); if (ctrl != null) { role.transform.position = roleData.StartPosition; role.transform.eulerAngles = Vector3.zero; role.name = roleData.Id; ctrl.IsHost = roleData.IsHost; ctrl.RoleData = roleData; roleCtrls.Add(roleData.Id, ctrl); } } }
public File GetFuturePeriodBreachesReportFile(RoleData role, int weeksToBreach, Format format, Layout layout, int hospitalId, string specialtyCode, int clinicianId, Granularity granularity) { string outputFileName; string templateFileName; switch (granularity) { case Granularity.Specialty: switch (layout) { case Layout.BarChart: templateFileName = "CPMS.Report.Rendering.Adapters.Templates.FuturePeriodBreaches_Specialty_BarChart.rdlc"; break; case Layout.Tabular: templateFileName = "CPMS.Report.Rendering.Adapters.Templates.FuturePeriodBreaches_Specialty_Tabular.rdlc"; break; default: throw new NotSupportedException(string.Format("Layout {0} is not supported!", layout)); } outputFileName = "FuturePeriodBreachesBySpecialty"; break; case Granularity.Clinician: switch (layout) { case Layout.BarChart: templateFileName = "CPMS.Report.Rendering.Adapters.Templates.FuturePeriodBreaches_Clinician_BarChart.rdlc"; break; case Layout.Tabular: templateFileName = "CPMS.Report.Rendering.Adapters.Templates.FuturePeriodBreaches_Clinician_Tabular.rdlc"; break; default: throw new NotSupportedException(string.Format("Layout {0} is not supported!", layout)); } outputFileName = "FuturePeriodBreachesByClinician"; break; case Granularity.Hospital: switch (layout) { case Layout.BarChart: templateFileName = "CPMS.Report.Rendering.Adapters.Templates.FuturePeriodBreaches_Hospital_BarChart.rdlc"; break; case Layout.Tabular: templateFileName = "CPMS.Report.Rendering.Adapters.Templates.FuturePeriodBreaches_Hospital_Tabular.rdlc"; break; default: throw new NotSupportedException(string.Format("Layout {0} is not supported!", layout)); } outputFileName = "FuturePeriodBreachesByHospital"; break; default: throw new NotSupportedException(string.Format("Granularity {0} is not supported!", granularity)); } var futurePeriodBreachesReportData = _reportPresentationService.GetFuturePeriodBreachesReport(role, weeksToBreach, hospitalId, specialtyCode, clinicianId, granularity); var reportDataSource = new ReportDataSource("FuturePeriodBreaches", futurePeriodBreachesReportData); return(GetReportFile(format, templateFileName, outputFileName, reportDataSource)); }
/// <summary> /// 將字典傳入,依json表設定資料 /// </summary> public static void SetData(Dictionary<int, RoleData> _dic) { string jsonStr = Resources.Load<TextAsset>("Json/Role").ToString(); JsonData jd = JsonMapper.ToObject(jsonStr); JsonData items = jd["Role"]; for (int i = 0; i < items.Count; i++) { RoleData data = new RoleData(items[i]); int id = int.Parse(items[i]["ID"].ToString()); _dic.Add(id, data); } }
public PlayerInfo(RoleData data, Socket socket) { roleData = data; clientPeer = socket; }
public Drunkard(RoleData data, SimDescription s, IRoleGiver roleGiver) : base(data, s, roleGiver) { }
// Use this for initialization public void InitRoleData() { //curLevel = 0; //roleData = this.GetRoleById(1); //roleData.starData = this.GetRoleStarById(1001); //emenyData = this.GetRoleById(1); //emenyData.starData = this.GetRoleStarById(1001); //string path1 = Application.dataPath + "\\Resources\\DataTest\\staticBox.csv"; //string path2 = Application.dataPath + "\\Resources\\DataTest\\moveBox.csv"; //string path3 = Application.dataPath + "\\Resources\\DataTest\\cursor.csv"; //string path4 = Application.dataPath + "\\Resources\\DataTest\\staticBoxRule.csv"; //string path5 = Application.dataPath + "\\Resources\\DataTest\\battle.csv"; //string path6 = Application.dataPath + "\\Resources\\DataTest\\shuaijian.csv"; //string path7 = Application.dataPath + "\\Resources\\DataTest\\xishu.csv"; //string path8 = Application.dataPath + "\\Resources\\DataTest\\level.csv"; TextAsset binAsset = Resources.Load("DataTest/staticBox", typeof(TextAsset)) as TextAsset; string path1 = binAsset.text; binAsset = Resources.Load("DataTest/moveBox", typeof(TextAsset)) as TextAsset; string path2 = binAsset.text; binAsset = Resources.Load("DataTest/cursor", typeof(TextAsset)) as TextAsset; string path3 = binAsset.text; binAsset = Resources.Load("DataTest/staticBoxRule", typeof(TextAsset)) as TextAsset; string path4 = binAsset.text; binAsset = Resources.Load("DataTest/battle", typeof(TextAsset)) as TextAsset; string path5 = binAsset.text; binAsset = Resources.Load("DataTest/shuaijian", typeof(TextAsset)) as TextAsset; string path6 = binAsset.text; binAsset = Resources.Load("DataTest/xishu", typeof(TextAsset)) as TextAsset; string path7 = binAsset.text; binAsset = Resources.Load("DataTest/level", typeof(TextAsset)) as TextAsset; string path8 = binAsset.text; List <string[]> staticStr = GetString(path1); List <string[]> moveStr = GetString(path2); List <string[]> cursorStr = GetString(path3); List <string[]> staticRuleStr = GetString(path4); List <string[]> battle = GetString(path5); List <string[]> shuaijian = GetString(path6); List <string[]> x = GetString(path7); List <string[]> level = GetString(path8); //块 roleData = new RoleData(); staticStr.RemoveAt(0); moveStr.RemoveAt(0); cursorStr.RemoveAt(0); staticRuleStr.RemoveAt(0); battle.RemoveAt(0); shuaijian.RemoveAt(0); x.RemoveAt(0); level.RemoveAt(0); emenyData = new RoleData(); RoleData.CycleAttr[] staticCycleList = new RoleData.CycleAttr[staticStr.Count]; RoleData.CycleAttr[] moveCycleList = new RoleData.CycleAttr[moveStr.Count]; //填充数据 roleData.staticCycleList = new List <RoleData.CycleAttr>(); emenyData.staticCycleList = new List <RoleData.CycleAttr>(); for (int i = 0; i < staticStr.Count; i++) { roleData.staticCycleList.Add(getCycleData(staticStr[i])); emenyData.staticCycleList.Add(getCycleData(staticStr[i])); } roleData.moveCycleList = new List <RoleData.CycleAttr>(); emenyData.moveCycleList = new List <RoleData.CycleAttr>(); for (int i = 0; i < moveStr.Count; i++) { roleData.moveCycleList.Add(getCycleData(moveStr[i])); emenyData.moveCycleList.Add(getCycleData(moveStr[i])); } //游标 cursorSpeedList = getCursorData(cursorStr); //规则 staticRule = getStaticRule(staticRuleStr); //战斗 //roleData.wakeLevelAttrList = DBManager.Instance.QueryWakeAttrList(1); //emenyData.wakeLevelAttrList = DBManager.Instance.QueryWakeAttrList(2); //emenyData.wakeLevelAttrList.RemoveRange(0, 5); //固定 //衰减 attenuationList = getShuaijian(shuaijian); xishu = GetXishu(x); //Role.GetComponent<MonsterMgr>().data = roleData; //Emeny.GetComponent<MonsterMgr>().data = emenyData; }
public Anysim(RoleData data, SimDescription s, IRoleGiver roleGiver) : base(data, s, roleGiver) { base.mIsStoryProgressionProtected = false; }
public ExoticDancer(RoleData data, SimDescription s, IRoleGiver roleGiver) : base(data, s, roleGiver) { }