public void StopListenBumpedEnemy(EntityCondition bumpedConditionNow) { bumpedEnemies.Remove(bumpedConditionNow); bumpedConditionNow.OnZeroCondition -= PlayerSessionHandler.IncreaseDefeatedEnemiesCount; bumpedConditionNow.OnZeroCondition -= delegate { AddHealthForEnemyDestroy(bumpedConditionNow.maxCondition); }; bumpedConditionNow.OnZeroCondition -= delegate { StopListenBumpedEnemy(bumpedConditionNow); }; }
public void SetDamage(EntityCondition targetToHit) { if (!ReferenceEquals(targetToHit, null)) { targetToHit.AddDamage(battleUnitData.damage); } }
public void SetDamage(EntityCondition targetToHit) { if (!ReferenceEquals(targetToHit, null)) { targetToHit.AddDamage(battleUnitData.damage - ((_transform.position - targetToHit.transform.position).magnitude * 10f)); } }
public override void DataSelect(int intKbn, object objList) { switch ((ExWebService.geWebServiceCallKbn)intKbn) { case _GetWebServiceCallKbn: if (objList != null) { _entity = (ObservableCollection <EntityCondition>)objList; EntityCondition entity = new EntityCondition(); // 明細初期設定 InitDetail(ref entity); _entity.Add(entity); SetDetailRecNo(); this.dg.ItemsSource = _entity; if (ExCast.zCInt(_entity[0]._lock_flg) == 0) { this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Upd; ExBackgroundWorker.DoWork_Focus(this.dg, 100); ExBackgroundWorker.DoWork_SelectedIndex(this.dg, 400, 0); ExBackgroundWorker.DoWork_DataGridColum(this.dg, 500, dg.Columns[0]); } else { this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Sel; } } else { _entity = new ObservableCollection <EntityCondition>(); EntityCondition entity = new EntityCondition(); // 明細初期設定 InitDetail(ref entity); _entity.Add(entity); SetDetailRecNo(); this.dg.ItemsSource = _entity; this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Upd; ExBackgroundWorker.DoWork_Focus(this.dg, 100); ExBackgroundWorker.DoWork_SelectedIndex(this.dg, 400, 0); ExBackgroundWorker.DoWork_DataGridColum(this.dg, 500, dg.Columns[0]); } break; default: break; } }
private void SetInitCombo(ref EntityCondition entity) { // コンボボックス初期選択 List <string> lst; lst = MeiNameList.GetListMei(MeiNameList.geNameKbn.DISPLAY_DIVISION_ID); entity._display_division_nm = lst[1]; entity._display_division_id = MeiNameList.GetID(MeiNameList.geNameKbn.BREAKDOWN_ID, lst[1]); }
public void StartListenBumpedEnemy(EntityCondition bumpedConditionNow) { if (!bumpedEnemies.Contains(bumpedConditionNow)) { bumpedEnemies.Add(bumpedConditionNow); bumpedConditionNow.OnZeroCondition += delegate { AddHealthForEnemyDestroy(bumpedConditionNow.maxCondition); }; bumpedConditionNow.OnZeroCondition += PlayerSessionHandler.IncreaseDefeatedEnemiesCount; bumpedConditionNow.OnZeroCondition += delegate { StopListenBumpedEnemy(bumpedConditionNow); }; } }
private void OnEnable() { allFixedTicks.Add(this); _transform = transform; condition = GetComponent <EntityCondition>(); condition.ResetCurrentCondition(helicopterData.maxCondition); helicopterData.PermanentSetUpHelicopter(this); InjectNewTargetData(GameObject.Find("PlayerTruckPreset(Clone)").GetComponent <Rigidbody>()); }
public void AwakeEvent(Vector3 playerPosition) { RandomizeData(); _transform = transform; _transform.position = playerPosition - new Vector3(0, 0, helicopterData.zSpawnOffset); condition = GetComponent <EntityCondition>(); condition.OnZeroCondition += ReturnObjectsToPool; helicopterData.PermanentSetUpHelicopter(this); InjectNewTargetData(PlayerHandler.PlayerInstance.truck._rigidbody); condition.ResetCondition(EnemyHandler.EnemyConditionCalculatedFromPlayerLevelAndComplexity()); }
private void OnCollisionExit(Collision collision) { if (collision.gameObject.tag == EnemyTag) { EntityCondition bumpedConditionNow = collision.collider.GetComponentInParent <EntityCondition>(); if (!ReferenceEquals(bumpedConditionNow, null)) { if (!ReferenceEquals(bumpedConditionNow, FirstTrackingGroupsTarget.target_condition)) { StopListenBumpedEnemy(bumpedConditionNow); } } } }
/// <summary> /// Create and insert a quick tab /// along with all the other needed entities. /// It will have the provided system name, display name, and HTML. /// It will display ONLY for a single product whose ID is given. /// </summary> public async Task InsertQuickTabForSpecificProductAsync( string systemName, string displayName, string html, int productId) { Tab tab = new Tab(); tab.SystemName = systemName; tab.DisplayName = displayName; tab.Description = html; tab.LimitedToStores = false; tab.TabMode = TabMode.Mappings; tab.DisplayOrder = 0; await _tabService.InsertTabAsync(tab); Condition condition = await _conditionService.CreateConditionAsync(); condition.Active = true; await _conditionService.UpdateConditionAsync(condition); EntityCondition entityCondition = new EntityCondition(); entityCondition.ConditionId = condition.Id; entityCondition.EntityType = EntityType.Tab; entityCondition.EntityId = tab.Id; entityCondition.LimitedToStores = false; await _entityConditionService.InsertEntityConditionAsync(entityCondition); ConditionGroup conditionGroup = new ConditionGroup(); await _conditionService.CreateConditionGroupAsync(condition, conditionGroup); ConditionStatement conditionStatement = new ConditionStatement(); await _conditionService.CreateConditionStatementAsync(conditionGroup, conditionStatement); conditionStatement.Value = "Fail"; await _conditionService.UpdateConditionStatementAsync(conditionStatement); EntityMapping entityMapping = new EntityMapping(); entityMapping.EntityType = EntityType.Tab; entityMapping.EntityId = tab.Id; entityMapping.MappedEntityId = productId; entityMapping.DisplayOrder = 0; entityMapping.MappingType = MappingType.Product; await _entityMappingService.InsertEntityMappingAsync(entityMapping); }
private void dg_CellEditEnded(object sender, DataGridCellEditEndedEventArgs e) { EntityCondition entity = (EntityCondition)e.Row.DataContext; // コンボボックスID連動 switch (e.Column.DisplayIndex) { case 2: // 表示区分 if (_entity == null) { return; } if (_entity.Count >= dg.SelectedIndex && dg.SelectedIndex != -1) { _entity[dg.SelectedIndex]._display_division_id = MeiNameList.GetID(MeiNameList.geNameKbn.DISPLAY_DIVISION_ID, ExCast.zCStr(entity._display_division_nm)) - 1; } break; } }
// F3ボタン(行挿入) クリック public override void btnF3_Click(object sender, RoutedEventArgs e) { try { // 明細初期設定 EntityCondition entity = new EntityCondition(); InitDetail(ref entity); int _selectedIndex = 0; int _displayIndex = 0; if (_entity == null) { _entity = new ObservableCollection <EntityCondition>(); _entity.Add(entity); SetDetailRecNo(); } else { if (this.dg.ConfirmEditEnd() == false) { return; } _selectedIndex = dg.SelectedIndex; _displayIndex = this.dg.CurrentColumn.DisplayIndex; _entity.Insert(_selectedIndex + 1, entity); SetDetailRecNo(); dg.SelectedIndex = _selectedIndex; this.dg.CurrentColumn = this.dg.Columns[_displayIndex]; } } catch (Exception ex) { ExMessageBox.Show(CLASS_NM + ".btnF3_Click : 予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message); } }
public void Pattern_Conditions() { Project p = new Project(); MathSystem s = p.CurrentSystem; // sin(x^2) Signal x = Binder.CreateSignal(); x.Label = "x"; Std.ConstrainAlwaysReal(x); Signal x2 = StdBuilder.Power(x, IntegerValue.ConstantTwo); x2.Label = "x2"; Signal sinx2 = StdBuilder.Sine(x2); sinx2.Label = "sinx2"; AlwaysTrueCondition ctrue = AlwaysTrueCondition.Instance; Assert.AreEqual(true, ctrue.FulfillsCondition(x, x.DrivenByPort), "A01"); EntityCondition centity = new EntityCondition(new MathIdentifier("Sine", "Std")); Assert.AreEqual(true, centity.FulfillsCondition(sinx2, sinx2.DrivenByPort), "A02"); Assert.AreEqual(false, centity.FulfillsCondition(x2, x2.DrivenByPort), "A03"); //InputSignalsPropertyCondition cinputconst = new InputSignalsPropertyCondition(new MathIdentifier("Constant", "Std"), CombinationMode.AtLeastOne); InputSignalsFlagCondition cinputconst = new InputSignalsFlagCondition(StdAspect.ConstantFlag, FlagState.Enabled, CombinationMode.AtLeastOne); Assert.AreEqual(true, cinputconst.FulfillsCondition(x2, x2.DrivenByPort), "A04"); Assert.AreEqual(false, cinputconst.FulfillsCondition(sinx2, sinx2.DrivenByPort), "A05"); OrCondition cor = new OrCondition(centity, cinputconst); Assert.AreEqual(true, cor.FulfillsCondition(x2, x2.DrivenByPort), "A06"); Assert.AreEqual(true, cor.FulfillsCondition(sinx2, sinx2.DrivenByPort), "A07"); Assert.AreEqual(false, cor.FulfillsCondition(x, x.DrivenByPort), "A08"); AndCondition cand = new AndCondition(ctrue, centity); Assert.AreEqual(true, cand.FulfillsCondition(sinx2, sinx2.DrivenByPort), "A09"); Assert.AreEqual(false, cand.FulfillsCondition(x2, x2.DrivenByPort), "A10"); }
public List <EntityCondition> GetCondition(string random) { EntityCondition entity; List <EntityCondition> entityList = new List <EntityCondition>(); #region 認証処理 string companyId = ""; string groupId = ""; string userId = ""; string ipAdress = ""; string sessionString = ""; try { companyId = ExCast.zCStr(HttpContext.Current.Session[ExSession.COMPANY_ID]); groupId = ExCast.zCStr(HttpContext.Current.Session[ExSession.GROUP_ID]); userId = ExCast.zCStr(HttpContext.Current.Session[ExSession.USER_ID]); ipAdress = ExCast.zCStr(HttpContext.Current.Session[ExSession.IP_ADRESS]); sessionString = ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]); string _message = ExSession.SessionUserUniqueCheck(random, ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR]), ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID])); if (_message != "") { entity = new EntityCondition(); entity.MESSAGE = _message; entityList.Add(entity); return(entityList); } } catch (Exception ex) { CommonUtl.ExLogger.Error(CLASS_NM + ".GetCondition(認証処理)", ex); entity = new EntityCondition(); entity.MESSAGE = CLASS_NM + ".GetCondition : 認証処理に失敗しました。" + Environment.NewLine + ex.Message.ToString();; entityList.Add(entity); return(entityList); } #endregion StringBuilder sb; DataTable dt; ExMySQLData db; try { db = ExSession.GetSessionDb(ExCast.zCInt(HttpContext.Current.Session[ExSession.USER_ID]), ExCast.zCStr(HttpContext.Current.Session[ExSession.SESSION_RANDOM_STR])); sb = new StringBuilder(); #region SQL sb.Append("SELECT MT.* " + Environment.NewLine); sb.Append(" ,NM.DESCRIPTION AS DISPLAY_DIVISION_NAME " + Environment.NewLine); sb.Append(" FROM M_CONDITION AS MT" + Environment.NewLine); #region Join // 表示区分 sb.Append(" LEFT JOIN SYS_M_NAME AS NM" + Environment.NewLine); sb.Append(" ON NM.DELETE_FLG = 0 " + Environment.NewLine); sb.Append(" AND NM.DISPLAY_FLG = 1 " + Environment.NewLine); sb.Append(" AND NM.DIVISION_ID = " + (int)CommonUtl.geNameKbn.DISPLAY_DIVISION_ID + Environment.NewLine); sb.Append(" AND NM.ID = MT.DISPLAY_FLG" + Environment.NewLine); #endregion sb.Append(" WHERE MT.COMPANY_ID = " + companyId + Environment.NewLine); sb.Append(" AND MT.DELETE_FLG = 0 " + Environment.NewLine); sb.Append(" ORDER BY MT.COMPANY_ID " + Environment.NewLine); sb.Append(" ,MT.ID " + Environment.NewLine); #endregion dt = db.GetDataTable(sb.ToString()); // 排他制御 DataPgLock.geLovkFlg lockFlg; string strErr = DataPgLock.SetLockPg(companyId, userId, PG_NM, "", ipAdress, db, out lockFlg); if (strErr != "") { entity = new EntityCondition(); entity.MESSAGE = CLASS_NM + ".GetCommodity : 排他制御(ロック情報取得)に失敗しました。" + Environment.NewLine + strErr; entityList.Add(entity); return(entityList); } if (dt.DefaultView.Count > 0) { for (int i = 0; i <= dt.DefaultView.Count - 1; i++) { #region Set Entity entity = new EntityCondition(); entity.id = ExCast.zCStr(dt.DefaultView[i]["ID"]); entity.condition_divition_id = ExCast.zCInt(dt.DefaultView[i]["CONDITION_DIVISION_ID"]); entity.name = ExCast.zCStr(dt.DefaultView[i]["NAME"]); entity.display_division_id = ExCast.zCInt(dt.DefaultView[i]["DISPLAY_FLG"]); entity.display_division_nm = ExCast.zCStr(dt.DefaultView[i]["DISPLAY_DIVISION_NAME"]); entity.memo = ExCast.zCStr(dt.DefaultView[i]["MEMO"]); entity.lock_flg = (int)lockFlg; entityList.Add(entity); #endregion } } } catch (Exception ex) { CommonUtl.ExLogger.Error(CLASS_NM + ".GetCondition", ex); entityList.Clear(); entity = new EntityCondition(); entity.MESSAGE = CLASS_NM + ".GetCondition : 予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message.ToString(); entityList.Add(entity); } finally { db = null; } svcPgEvidence.gAddEvidence(ExCast.zCInt(HttpContext.Current.Session[ExSession.EVIDENCE_SAVE_FLG]), companyId, userId, ipAdress, sessionString, PG_NM, DataPgEvidence.geOperationType.Select, ""); return(entityList); }
private void InitDetail(ref EntityCondition entity) { entity._condition_divition_id = 1; SetInitCombo(ref entity); }
/// <summary> /// Create and insert an HTML widget /// along with all the other needed entities. /// It will have the provided name and HTML. /// It will display in the provided widget zone /// with the given display order. /// </summary> /// <returns> /// The ID of the inserted HTML widget. /// </returns> public async Task <int> InsertHtmlWidgetAsync( string name, string html, string widgetZone, int displayOrder) { HtmlWidget widget = new HtmlWidget(); widget.Name = name; widget.Visible = true; widget.HtmlContent = html; widget.LimitedToStores = false; await _htmlWidgetRepository.InsertAsync(widget); Schedule schedule = new Schedule(); schedule.EntityType = EntityType.HtmlWidget; schedule.EntityId = widget.Id; schedule.EntityFromDate = null; schedule.EntityToDate = null; schedule.SchedulePatternType = SchedulePatternType.Everyday; schedule.SchedulePatternFromTime = TimeSpan.Zero; schedule.SchedulePatternToTime = TimeSpan.Zero; schedule.ExactDayValue = 1; schedule.EveryMonthFromDayValue = 1; schedule.EveryMonthToDayValue = 1; await _scheduleRepository.InsertAsync(schedule); Condition condition = new Condition(); condition.Name = null; condition.Active = true; await _conditionRepository.InsertAsync(condition); EntityCondition entityCondition = new EntityCondition(); entityCondition.ConditionId = condition.Id; entityCondition.EntityType = EntityType.HtmlWidget; entityCondition.EntityId = widget.Id; entityCondition.LimitedToStores = false; await _entityConditionRepository.InsertAsync(entityCondition); ConditionGroup conditionGroup = new ConditionGroup(); conditionGroup.ConditionId = condition.Id; await _conditionGroupRepository.InsertAsync(conditionGroup); ConditionStatement conditionStatement = new ConditionStatement(); conditionStatement.ConditionType = ConditionType.Default; conditionStatement.ConditionProperty = 0; conditionStatement.OperatorType = OperatorType.EqualTo; conditionStatement.Value = "Fail"; conditionStatement.ConditionGroupId = conditionGroup.Id; await _conditionStatementRepository.InsertAsync(conditionStatement); EntityWidgetMapping widgetMapping = new EntityWidgetMapping(); widgetMapping.EntityType = EntityType.HtmlWidget; widgetMapping.EntityId = widget.Id; widgetMapping.WidgetZone = widgetZone; widgetMapping.DisplayOrder = displayOrder; await _widgetMappingRepository.InsertAsync(widgetMapping); return(widget.Id); }
// F3ボタン(行挿入) クリック public override void btnF3_Click(object sender, RoutedEventArgs e) { try { // 明細初期設定 EntityCondition entity = new EntityCondition(); InitDetail(ref entity); int _selectedIndex = 0; int _displayIndex = 0; if (_entity == null) { _entity = new ObservableCollection<EntityCondition>(); _entity.Add(entity); SetDetailRecNo(); } else { if (this.dg.ConfirmEditEnd() == false) return; _selectedIndex = dg.SelectedIndex; _displayIndex = this.dg.CurrentColumn.DisplayIndex; _entity.Insert(_selectedIndex + 1, entity); SetDetailRecNo(); dg.SelectedIndex = _selectedIndex; this.dg.CurrentColumn = this.dg.Columns[_displayIndex]; } } catch (Exception ex) { ExMessageBox.Show(CLASS_NM + ".btnF3_Click : 予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message); } }
public void SetDamage(EntityCondition targetToHit) { }
public override void DataSelect(int intKbn, object objList) { switch ((ExWebService.geWebServiceCallKbn)intKbn) { case _GetWebServiceCallKbn: if (objList != null) { _entity = (ObservableCollection<EntityCondition>)objList; EntityCondition entity = new EntityCondition(); // 明細初期設定 InitDetail(ref entity); _entity.Add(entity); SetDetailRecNo(); this.dg.ItemsSource = _entity; if (ExCast.zCInt(_entity[0]._lock_flg) == 0) { this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Upd; ExBackgroundWorker.DoWork_Focus(this.dg, 100); ExBackgroundWorker.DoWork_SelectedIndex(this.dg, 400, 0); ExBackgroundWorker.DoWork_DataGridColum(this.dg, 500, dg.Columns[0]); } else { this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Sel; } } else { _entity = new ObservableCollection<EntityCondition>(); EntityCondition entity = new EntityCondition(); // 明細初期設定 InitDetail(ref entity); _entity.Add(entity); SetDetailRecNo(); this.dg.ItemsSource = _entity; this.utlFunctionKey.gFunctionKeyEnable = Utl_FunctionKey.geFunctionKeyEnable.Upd; ExBackgroundWorker.DoWork_Focus(this.dg, 100); ExBackgroundWorker.DoWork_SelectedIndex(this.dg, 400, 0); ExBackgroundWorker.DoWork_DataGridColum(this.dg, 500, dg.Columns[0]); } break; default: break; } }
public TargetData(Rigidbody target_rigidbody, EntityCondition target_condition) { this.target_rigidbody = target_rigidbody; this.target_condition = target_condition; }
private void SetInitCombo(ref EntityCondition entity) { // コンボボックス初期選択 List<string> lst; lst = MeiNameList.GetListMei(MeiNameList.geNameKbn.DISPLAY_DIVISION_ID); entity._display_division_nm = lst[1]; entity._display_division_id = MeiNameList.GetID(MeiNameList.geNameKbn.BREAKDOWN_ID, lst[1]); }