public HttpResponseMessage UpdateManagerType(HttpRequestMessage reqObject) { int result = 0; _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject); if (_requestedDataObject != null && _requestedDataObject.BusinessData != null) { _ManagerType = JsonConvert.DeserializeObject <ManagerType>(_requestedDataObject.BusinessData); bool IsValid = ModelValidation.TryValidateModel(_ManagerType, out _modelErrorMsg); if (IsValid) { result = _IManagerTypeService.UpdateManagerType(_ManagerType); } } if (!string.IsNullOrWhiteSpace(_modelErrorMsg)) { _serviceResponse = _IDataManipulation.SetResponseObject(result, _modelErrorMsg); } else if (result == 1) { _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been updated successfully"); } else { _serviceResponse = _IDataManipulation.SetResponseObject(result, "information hasn't been updated"); } _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject); return(_response); }
public InstanceManager(ManagerType _type) { loadedType = _type; switch (loadedType) { case ManagerType.PROPS: loadedTypeString = "prop"; folderPath = "PROPCONFIGS"; break; case ManagerType.TILES: loadedTypeString = "tile"; folderPath = "TILECONFIGS"; break; } InitializeComponent(); ReloadList(); string managerNameCapsFirst = loadedTypeString[0].ToString().ToUpper() + loadedTypeString.Substring(1); this.Name = managerNameCapsFirst + " Manager"; newInstance.Text = "New " + managerNameCapsFirst; editInstance.Text = "Edit Selected " + managerNameCapsFirst; deleteInstance.Text = "Delete Selected " + managerNameCapsFirst; }
/// <summary> /// 战斗准备 初始化敌人 显示警告 /// </summary> private void battleReady() { enemyWarning.GetComponent <Animator> ().SetTrigger("Show"); initEnemy(); battleType = ManagerType.BATTLE_ENTER; }
public BuildManagerFields() { ManagerType = typeof(BuildManager); // https://github.com/dotnet/msbuild/blob/d07c47adec8d5cf40718ef9a618b0b959cc8be0d/src/Build/BackEnd/BuildManager/BuildManager.cs#L80 ConfigCache = ManagerType.GetField("_configCache", PrivateFlags) !; ResultsCache = ManagerType.GetField("_resultsCache", PrivateFlags) !; }
public void RegisterAM(ManagerType mType, IAssetManager mgr) { if (!AMgr.ContainsKey(mType)) { AMgr.Add(mType, mgr); } }
public HttpResponseMessage GetManagerTypeById(HttpRequestMessage reqObject) { string ManagerTypeId = string.Empty; _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject); if (_requestedDataObject != null && _requestedDataObject.BusinessData != null) { _ManagerType = JsonConvert.DeserializeObject <ManagerType>(_requestedDataObject.BusinessData); ManagerTypeId = _ManagerType.ManTypeId; } if (!string.IsNullOrWhiteSpace(ManagerTypeId)) { _ManagerType = new ManagerType(); _ManagerType = _IManagerTypeService.GetManagerTypeById(ManagerTypeId); } if (_ManagerType != null) { _serviceResponse = _IDataManipulation.ResopnseWhenDataFound(_ManagerType, "information has been fetched successfully"); } else { _serviceResponse = _IDataManipulation.ResopnseWhenDataNotFound("Manager Type Not Found..."); } _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject); return(_response); }
/// <summary> /// 添加目标到行动单位 /// </summary> /// <param name="target">可攻击目标</param> /// <returns></returns> public bool addTargetToUnit(BattleUnit target) { if (unitAction != null) { unitAction.targetList.Add(target); } if (unitType == ManagerType.BATTLE_UNIT_ATK) { unitAction.setAttackType(BattleUnit.UnitType.ATTACK_ATK); unitAction.setActionTypeToJudge(); unitType = BattleManager.ManagerType.BATTLE_UNIT_NONE; return(true); } else if (unitType == ManagerType.BATTLE_UNIT_SKILL) { int skillcount = 1; if (unitAction.targetList.Count >= skillcount) { unitAction.setAttackType(BattleUnit.UnitType.ATTACK_SKILL); unitAction.setActionTypeToJudge(); unitType = BattleManager.ManagerType.BATTLE_UNIT_NONE; } return(true); } return(false); }
static ExplorerSettings() { config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); try { /*if (config.AppSettings.Settings["LoggerMode"].Value == "info") logger = LoggerMode.info; else if (config.AppSettings.Settings["LoggerMode"].Value == "debug") logger = LoggerMode.debug; else throw new Exception("LoggerMode is set improperly.");*/ loggingDirectory = config.AppSettings.Settings["LoggingDirectory"].Value; storageDirectory = config.AppSettings.Settings["StorageDirectory"].Value; //connectionString = config.ConnectionStrings.ConnectionStrings[config.AppSettings.Settings["SQLProvider"].Value].ConnectionString; tracingDirectory = config.AppSettings.Settings["TracingDirectory"].Value; workingMode = (ManagerType)Enum.Parse(typeof(ManagerType), config.AppSettings.Settings["WorkingMode"].Value); staticGenerationDirectory = config.AppSettings.Settings["StaticGenerationDirectory"].Value; matrixConvertionToolDirectory = config.AppSettings.Settings["MatrixConvertionToolDirectory"].Value; modelCheckingToolDirectory = config.AppSettings.Settings["ModelCheckingToolDirectory"].Value; } catch { throw new CoreException("The structure of Configuration file is not correct."); } }
public void RegisterAM(ManagerType mType, RefManager <int> mgr) { if (!AMgr.ContainsKey(mType)) { AMgr.Add(mType, mgr); } }
private void autoBattle() { // 技能&普攻 unitType = ManagerType.BATTLE_UNIT_ATK; // 随机目标 if (unitAction.getCampType() == BattleUnit.UnitType.CAMP_OUR) { foreach (var item in enemyUnitList) { if (addTargetToUnit(item.GetComponent <BattleUnit> ())) { break; } } } else if (unitAction.getCampType() == BattleUnit.UnitType.CAMP_ENEMY) { foreach (var item in ourUnitList) { if (addTargetToUnit(item.GetComponent <BattleUnit> ())) { break; } } } }
public HttpResponseMessage DeleteManagerType(HttpRequestMessage reqObject) { int result = 0; _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject); if (_requestedDataObject != null && _requestedDataObject.BusinessData != null) { _ManagerType = JsonConvert.DeserializeObject <ManagerType>(_requestedDataObject.BusinessData); } if (_ManagerType == null || string.IsNullOrWhiteSpace(_ManagerType.ManTypeId)) { _serviceResponse = _IDataManipulation.SetResponseObject(result, "Manager TypeId Not Found..."); _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject); return(_response); } result = _IManagerTypeService.DeleteManagerType(_ManagerType); if (result == 1) { _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been deleted successfully"); } else { _serviceResponse = _IDataManipulation.SetResponseObject(result, "information hasn't been deleted"); } _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject); return(_response); }
public string[] UpdateManagersWorkFlow_ManagersWorkFlowPage(string FlowState, string FlowID, string IsActiveFlow, string IsMainFlow, string strFlowPartsList) { string[] retMessage = new string[4]; this.InitializeCulture(); try { AttackDefender.CSRFDefender(this.Page); UIActionType FS = (UIActionType)Enum.Parse(typeof(UIActionType), this.StringBuilder.CreateString(FlowState).ToUpper()); decimal flowID = decimal.Parse(this.StringBuilder.CreateString(FlowID), CultureInfo.InvariantCulture); bool isActiveFlow = bool.Parse(this.StringBuilder.CreateString(IsActiveFlow).ToLower()); bool isMainFlow = bool.Parse(this.StringBuilder.CreateString(IsMainFlow).ToLower()); strFlowPartsList = this.StringBuilder.CreateString(strFlowPartsList); IList <ManagerProxy> ManagerProxyList = new List <ManagerProxy>(); JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); object[] ParamsBatchs = (object[])jsSerializer.DeserializeObject(strFlowPartsList); foreach (object paramBatch in ParamsBatchs) { ManagerProxy managerProxy = new ManagerProxy(); managerProxy.Level = int.Parse(((Dictionary <string, object>)paramBatch)["Level"].ToString(), CultureInfo.InvariantCulture); ManagerType managerType = (ManagerType)Enum.ToObject(typeof(ManagerType), int.Parse(((Dictionary <string, object>)paramBatch)["Type"].ToString(), CultureInfo.InvariantCulture)); managerProxy.ManagerType = managerType; managerProxy.OwnerID = Int64.Parse(((Dictionary <string, object>)paramBatch)["TypeID"].ToString(), CultureInfo.InvariantCulture); ManagerProxyList.Add(managerProxy); } switch (FS) { case UIActionType.ADD: this.FlowBusiness.UpdateManagerFlows_onOrganizationFlowInsert(flowID, isActiveFlow, isMainFlow, ManagerProxyList); break; case UIActionType.EDIT: this.FlowBusiness.UpdateManagerFlows_onOrganizationFlowUpdate(flowID, isActiveFlow, isMainFlow, ManagerProxyList); break; } retMessage[0] = GetLocalResourceObject("RetSuccessType").ToString(); retMessage[1] = GetLocalResourceObject("OperationComplete").ToString(); retMessage[2] = "success"; return(retMessage); } catch (UIValidationExceptions ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage); return(retMessage); } catch (UIBaseException ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage); return(retMessage); } catch (Exception ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage); return(retMessage); } }
public IManager GetManager(ManagerType managerType) { if (dicManager.ContainsKey(managerType)) { return(dicManager[managerType]); } return(null); }
/// <summary> /// 战斗循环 死亡消失 结果判定 /// </summary> private void battleGame() { for (int i = 0; i < ourUnitList.Count;) { BattleUnit unit = ourUnitList[i].GetComponent <BattleUnit> (); if (unit.isDeadAndOut()) { unit.removeFromParent(); ourUnitList.RemoveAt(i); } else { i++; } } for (int i = 0; i < enemyUnitList.Count;) { BattleUnit unit = enemyUnitList[i].GetComponent <BattleUnit> (); if (unit.isDeadAndOut()) { unit.removeFromParent(); enemyUnitList.RemoveAt(i); } else { i++; } } if (ourUnitList.Count <= 0) { resultType = ManagerType.BATTLE_FAIL; showReceipt(); } else if (enemyUnitList.Count <= 0) { resultType = ManagerType.BATTLE_WIN; //显示结算界面 showReceipt(); } if (resultType != ManagerType.BATTLE_NONE) { battleType = ManagerType.BATTLE_NONE; var our = ourUnitList.GetEnumerator(); while (our.MoveNext()) { BattleUnit unit = our.Current.GetComponent <BattleUnit> (); unit.clearUnit(); } battleSettlement(); } }
public WeekPlan(WeekPlanCreate command) { ClientId = command.ClientId; Plan = command.Plan; WeekNumber = command.WeekNumber; ManagerType = command.ManagerType; Date = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); PlanTitle = command.PlanTitle; }
/// <summary> /// 战斗结束 清场 /// </summary> public void closeLayer() { buttonPanel.GetComponent <Animator> ().SetTrigger("Exit"); moveHeadBack.SetActive(false); chooseIcon.SetActive(false); unitAction = null; battleType = ManagerType.BATTLE_NONE; }
/// <summary> /// 单位循环 /// </summary> private void unitLogic() { unitAction = null; var our = ourUnitList.GetEnumerator(); while (our.MoveNext()) { BattleUnit unit = our.Current.GetComponent <BattleUnit> (); unit.logic(Time.fixedDeltaTime); if (unit.isReady()) { unitAction = unit; } } var enemy = enemyUnitList.GetEnumerator(); while (enemy.MoveNext()) { BattleUnit unit = enemy.Current.GetComponent <BattleUnit> (); unit.logic(Time.fixedDeltaTime); if (unitAction == null) { if (unit.isReady()) { unitAction = unit; } } } if (unitAction != null) { battleType = ManagerType.BATTLE_PAUSE; unitAction.battleReady(); if (unitAction.getCampType() == BattleUnit.UnitType.CAMP_OUR) { if (isAutoBattle) { autoBattle(); } else { unitType = ManagerType.BATTLE_UNIT_WAIT; } } else { autoBattle(); } } }
public BaseManager GetManager(ManagerType type) { BaseManager mgr = managerDic.TryGet(type); if (mgr == null) { throw new System.Exception("没有找到对应管理器:" + type.ToString()); } return(mgr); }
/// <summary> /// 更新管理员类型信息 /// </summary> /// <param name="t">管理员类型对象</param> /// <returns></returns> public bool UpdateManagerTypeBySN(ManagerType t) { SqlParameter[] array = { new SqlParameter("@name", t.Name), new SqlParameter("@memo", t.Memo), new SqlParameter("@sn", t.Sn), }; return(DBUtil.ExecuteNonQuery(SQL_updateManagerTypeBySN, array) > 0); }
public override void OnInspectorGUI() { if (animatorController != null) { //toolBar selectedType = (ManagerType)GUILayout.Toolbar((int)selectedType, toolBarTitles); if (selectedType == ManagerType.TransitionSetting) { GUILayout.BeginHorizontal(); { GUILayout.Label("Has Exit Time:"); anyAnimatorTransition.hasExitTime = GUILayout.Toggle(anyAnimatorTransition.hasExitTime, "", GUILayout.ExpandWidth(false)); GUILayout.Label("Exit Time:"); anyAnimatorTransition.exitTime = EditorGUILayout.FloatField(anyAnimatorTransition.exitTime, GUILayout.ExpandWidth(false)); GUILayout.Label("Fixed Duration:"); anyAnimatorTransition.hasFixedDuration = GUILayout.Toggle(anyAnimatorTransition.hasFixedDuration, "", GUILayout.ExpandWidth(false)); GUILayout.Label("Transition duration:"); anyAnimatorTransition.duration = EditorGUILayout.FloatField(anyAnimatorTransition.duration, GUILayout.ExpandWidth(false)); GUILayout.Label("Transition offset:"); anyAnimatorTransition.offset = EditorGUILayout.FloatField(anyAnimatorTransition.offset, GUILayout.ExpandWidth(false)); } GUILayout.EndHorizontal(); GUILayout.Space(25f); GUILayout.BeginHorizontal(); { if (GUILayout.Button("全选/取消全选")) { isAllSelected = !isAllSelected; List <string> keys = new List <string>(); foreach (var item in batchesToggleDict.Keys) { keys.Add(item); } for (int i = 0; i < keys.Count; i++) { string key = keys[i]; batchesToggleDict[key] = isAllSelected; } } if (GUILayout.Button("批量设置")) { isSetAnyTransition = true; } } GUILayout.EndHorizontal(); } ShowLayersGUI(); } isSetAnyTransition = false; }
private void Awake() { ourUnitList = new List <GameObject> (); enemyUnitList = new List <GameObject> (); battleType = ManagerType.BATTLE_NONE; unitType = ManagerType.BATTLE_UNIT_NONE; resultType = ManagerType.BATTLE_NONE; isAutoBattle = false; }
public IManager get(ManagerType manager) { try { return(managers[manager]); } catch (KeyNotFoundException) { return(null); } }
/// <summary> /// 战斗开始 初始化 /// </summary> public void init() { buttonPanel.GetComponent <Animator> ().SetTrigger("Enter"); moveHeadBack.SetActive(true); battleType = ManagerType.BATTLE_READY; unitType = ManagerType.BATTLE_UNIT_NONE; resultType = ManagerType.BATTLE_NONE; updateHeadInfo(ourUnitList[0]); }
public T GetManager <T>(ManagerType managerType) where T : AbstractManager { var aggregator = aggregators.Find(a => a.ManagerType == managerType); if (aggregator == null) { return(null); } return(aggregator.Manager as T); }
/*********************************************************************************************/ public bool ExistManager(int userID, ManagerType managerType) { Check.Argument.IsNotNegativeOrZero(userID, "userID"); var paramters = new object[] { userID, (int)managerType }; var existCount = this.Context.Sql(existManager_Sql) .Parameters(paramters) .QuerySingle<int>(); return existCount > 0; }
public void DestroyService(ManagerType type) { foreach (Service service in m_Services) { if (service.m_Type == type) { Destroy(service); return; } } }
internal static string ToSerializedValue(this ManagerType value) { switch (value) { case ManagerType.GardaV1: return("GardaV1"); case ManagerType.HelsinkiV1: return("HelsinkiV1"); } return(null); }
public AbstractResearch() { ResearchID = Guid.NewGuid(); ResearchParameterValues = new Dictionary<ResearchParameter, object>(); GenerationParameterValues = new Dictionary<GenerationParameter, object>(); AnalyzeOption = AnalyzeOption.None; InitializeResearchParameters(); InitializeGenerationParameters(); managerType = RandNetSettings.WorkingMode; }
/// <summary> /// 添加管理员类型 /// </summary> /// <param name="t">管理员类型对象</param> /// <returns>影响条目数</returns> public int AddManagerType(ManagerType t) { int rowAffects = 0; SqlParameter[] array = { new SqlParameter("@sn", t.Sn), new SqlParameter("@name", t.Name), new SqlParameter("@memo", t.Memo), }; rowAffects = DBUtil.ExecuteNonQuery(SQL_addManagerType, array); return(rowAffects); }
public MyThreadManager(ManagerType managerType, IEnumerable <MyThread> threads = null) { _logger.Trace($"Creating new ThreadManager(ManagerType = {managerType.ToString()}"); this.ManagerType = managerType; if (threads != null) { this.Threads = new List <MyThread>(threads); } else { this.Threads = new List <MyThread>(); } }
public AbstractResearch() { ResearchID = Guid.NewGuid(); ResearchParameterValues = new Dictionary <ResearchParameter, object>(); GenerationParameterValues = new Dictionary <GenerationParameter, object>(); AnalyzeOption = AnalyzeOption.None; InitializeResearchParameters(); InitializeGenerationParameters(); managerType = RandNetSettings.WorkingMode; }
public static IMonitorManager GetInstance(ManagerType managerType = ManagerType.Win32, Object parameter = null) { IMonitorManager manager = null; try { manager = MonitorManagerMap[managerType]; } catch (Exception) { manager = (IMonitorManager)Activator.CreateInstance(ManagerTypeRecord[managerType], parameter); MonitorManagerMap.Add(managerType, manager); } return manager; }
void OnDestroy() { int count = (int)ManagerType.MAX_MANAGER_COUNT; for (int i = count - 1; i >= 0; --i) { ManagerType eType = (ManagerType)i; if (m_dicMgrs.ContainsKey(eType)) { m_dicMgrs[eType].UnInitialize(); } } Network.Instance.Disonnect(); }
public UDPManager Build(ManagerType type) { if (type == ManagerType.A) { return(new SomethingA()); } if (type == ManagerType.B) { return(new SomethingB()); } throw new Exception("type not found"); }
public AbstractResearch() { ResearchID = Guid.NewGuid(); Status = ResearchStatus.NotStarted; GenerationType = GenerationType.Random; ResearchParameterValues = new Dictionary<ResearchParameter, object>(); GenerationParameterValues = new Dictionary<GenerationParameter, object>(); AnalyzeOption = AnalyzeOption.None; InitializeResearchParameters(); InitializeGenerationParameters(); managerType = ExplorerSettings.WorkingMode; }
static RandNetSettings() { config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); try { loggingDirectory = config.AppSettings.Settings["LoggingDirectory"].Value; storageDirectory = config.AppSettings.Settings["StorageDirectory"].Value; //connectionString = config.ConnectionStrings.ConnectionStrings[config.AppSettings.Settings["SQLProvider"].Value].ConnectionString; tracingDirectory = config.AppSettings.Settings["TracingDirectory"].Value; workingMode = (ManagerType)Enum.Parse(typeof(ManagerType), config.AppSettings.Settings["WorkingMode"].Value); staticGenerationDirectory = config.AppSettings.Settings["StaticGenerationDirectory"].Value; matrixConvertionToolDirectory = config.AppSettings.Settings["MatrixConvertionToolDirectory"].Value; modelCheckingToolDirectory = config.AppSettings.Settings["ModelCheckingToolDirectory"].Value; dataConvertionToolDirectory = config.AppSettings.Settings["DataConvertionToolDirectory"].Value; } catch { throw new CoreException("The structure of Configuration file is not correct."); } }
public ActionResult AssignUserRole(int userID, ManagerType role) { if (userID <= 0) return Json(new JsonResult(-1)); bool exist = IoC.Resolve<IManagerQuery>().ExistManager(userID, role); if (exist) return Json(new JsonResult(-2)); else { try { var cmd = new UserAssignRole(userID, role, this.CurrentUser.UserID); this.CommandBus.Send(cmd); return Json(JsonResult.Success); } catch (CommandExecutionException ex) { if (ex.ErrorCode == (int)ErrorCode.NoPermission) return Json(new JsonResult(-3)); else return Json(new JsonResult(ex.ErrorCode)); } } }
public ManagerCreated(int userID, ManagerType managerType) { this.UserID = userID; this.ManagerType = managerType; }
public UserAssignRole(int userID, ManagerType managerType, int currentUserID) { Check.Argument.IsNotNegativeOrZero(userID, "userID"); Check.Argument.IsNotNull(managerType, "managerType"); Check.Argument.IsNotNegativeOrZero(currentUserID, "currentUserID"); this.UserID = userID; this.ManagerType = managerType; this.CurrentUserID = currentUserID; }
public HouseManager(ManagerType type) { Type = type; }
private void BindDDL() { IList<RouteInfo> dRouteList = new Route().GetList(); ddlRouteName.DataSource = dRouteList; ddlRouteName.DataBind(); IList<ManagerTypeInfo> mtList = new ManagerType().GetList(); ddlManagerType.DataSource = mtList; ddlManagerType.DataBind(); IList<ShipInfo> dShipList = new Ship().GetList(); ddlShipName.DataSource = dShipList; ddlShipName.DataBind(); ShipTypeInitial(); tbStartTime.Text = DateTime.Now.ToString("yyyy-MM-dd"); tbEndTime.Text = DateTime.Now.ToString("yyyy-MM-dd"); // 绑定小时和分钟 for (int i = 0; i < 24; i++) { ddlStartHour.Items.Add(new ListItem(i.ToString(), i.ToString())); ddlEndHour.Items.Add(new ListItem(i.ToString(), i.ToString())); } for (int j = 0; j < 60; j++) { ddlStartMin.Items.Add(new ListItem(j.ToString(), j.ToString())); ddlEndMin.Items.Add(new ListItem(j.ToString(), j.ToString())); } ddlStartHour.SelectedIndex = 0; ddlEndHour.SelectedIndex = 0; ddlStartMin.SelectedIndex = 0; ddlEndMin.SelectedIndex = 0; }
public UserAssignedRole(int userID, ManagerType managerType, int byManagerUserID) { this.UserID = userID; this.ManagerType = managerType; this.ByManagerUserID = byManagerUserID; }