private void fillFromCondition(TimeCondition timeCondition) { fillOperator(timeOperator, timeCondition); time.Text = timeCondition.Time; timeRb.Checked = true; }
private void UpdateGameSettings(string gameName, GameType gameType, Conditions conditions, TimeCondition timeCondition, ScoreCondition scoreCondition, PlayableMap selectedMap) { this.gameName = gameName; this.gameType = gameType; this.conditions = conditions; this.timeCondition = timeCondition; this.scoreCondition = scoreCondition; this.selectedMap = selectedMap; }
public void Execute(object parameter) { if ((((_info != null) && (_info.RowFilter != null)) && ((_excel != null) && (_excel.ActiveSheet != null))) && ((_column >= 0) && (_column < _excel.ActiveSheet.ColumnCount))) { HideRowFilter rowFilter = _info.RowFilter; object[] filterValues = parameter as object[]; _excel.ActiveSheet.Workbook.SuspendEvent(); try { rowFilter.Unfilter(_column); rowFilter.RemoveFilterItems(_column); if (filterValues != null) { for (int i = 0; i < filterValues.Length; i++) { object obj2 = filterValues[i]; if (obj2 is DateTime) { DateCondition filterItem = DateCondition.FromDateTime(DateCompareType.EqualsTo, (DateTime)obj2); rowFilter.AddFilterItem(_column, filterItem); } else if (obj2 is TimeSpan) { TimeSpan span = (TimeSpan)obj2; TimeCondition condition2 = TimeCondition.FromDateTime(DateCompareType.EqualsTo, Dt.Cells.Data.DateTimeExtension.FromOADate(span.TotalDays)); rowFilter.AddFilterItem(_column, condition2); } else { string expected = (string)(obj2 as string); if ((obj2 == BlankFilterItem.Blank) || (expected == null)) { expected = string.Empty; } TextCondition condition3 = TextCondition.FromString(TextCompareType.EqualsTo, expected); rowFilter.AddFilterItem(_column, condition3); } } } } catch { } finally { _excel.ActiveSheet.Workbook.ResumeEvent(); } if (!_excel.RaiseRangeFiltering(_column, filterValues)) { rowFilter.Filter(_column); _excel.RaiseRangeFiltered(_column, filterValues); } _excel.RefreshRange(-1, -1, -1, -1, SheetArea.Cells | SheetArea.ColumnHeader | SheetArea.RowHeader); _excel.RefreshFloatingObjects(); } }
private ITrigger CreateAutoTrigger(WorkflowStepData param) { WorkflowStepTrigger trigger = m_Instantiator.Instantiate <WorkflowStepTrigger>(); TimeCondition condition = m_Instantiator.Instantiate <TimeCondition>(); condition.time = TimeSpan.FromSeconds(param.durations[0]); trigger.AddCondition(condition, true); trigger.advance = true; trigger.mode = ConditionMode.and; m_DisposalService.Register(trigger, param.id); m_DisposalService.Register(condition, param.id); return(trigger); }
void SetGameSettings() { if (!PhotonNetwork.IsMasterClient) { return; } gameName = RoomManager.Instance.RoomName; gameType = RoomManager.Instance.GameType; conditions = RoomManager.Instance.Conditions; timeCondition = RoomManager.Instance.Time; scoreCondition = RoomManager.Instance.Score; selectedMap = RoomManager.Instance.SelectedMap; }
/// <summary> /// 1.放技能 /// </summary> /// <param name="skill"></param> public void Fire(Skill skill) { //to-do吟唱 吟唱时间可以根据表格来 TimeCondition singCond = new TimeCondition(skill.Attribute.m_DelayTime);// Task singTask = new Task("吟唱任务", singCond); m_tm.AddTask(singTask); Task emitTask = new Task("释放", new CastCondition(skill, 0.1f)); m_tm.AddTask(emitTask); //启动任务队列 m_tm.Start("吟唱任务"); }
public void Fire(Skill skill) { //to-do吟唱 吟唱时间可以根据表格来 TimeCondition singCond = new TimeCondition(0.5f); SkillTask singTask = new SkillTask("吟唱任务", singCond); TaskManager.Instance().AddTask(singTask); //伤害计算 DamageCondtion dmgCond = new DamageCondtion(skill, delegate(int result) { HandleCast(skill, result); }, EventsType.Skill_EndDmg); SkillTask dmgTask = new SkillTask("伤害检查", dmgCond); TaskManager.Instance().AddTask(dmgTask); //启动任务队列 TaskManager.Instance().Start(">>>技能伤害计算流程"); }
public void Fire(Skill skill) { //to-do吟唱 吟唱时间可以根据表格来 TimeCondition singCond = new TimeCondition(skill.Attribute.m_DelayTime); TaskSystem.Task singTask = new TaskSystem.Task("吟唱任务", singCond); TaskManager.Instance().AddTask(singTask); //伤害计算 DamageCondtion dmgCond = new DamageCondtion(skill, delegate(int result) { HandleCast(skill, result); }, EventsType.Skill_DamageEnd, skill.Caster.m_Id); TaskSystem.Task dmgTask = new TaskSystem.Task("伤害检查", dmgCond); TaskManager.Instance().AddTask(dmgTask); //启动任务队列 TaskManager.Instance().Start(">>>技能伤害计算流程"); }
public static OrderCondition Create(OrderConditionType type) { OrderCondition?rval = null; switch (type) { case OrderConditionType.Execution: rval = new ExecutionCondition(); break; case OrderConditionType.Margin: rval = new MarginCondition(); break; case OrderConditionType.PercentChange: rval = new PercentChangeCondition(); break; case OrderConditionType.Price: rval = new PriceCondition(); break; case OrderConditionType.Time: rval = new TimeCondition(); break; case OrderConditionType.Volume: rval = new VolumeCondition(); break; } if (rval != null) { rval.Type = type; } return(rval ?? throw new InvalidOperationException("Invalid OrderConditionType.")); }
public void Fire02(Skill skill) { string que01 = "蓄力队列>01"; TimeCondition singCond = new TimeCondition(skill.Attribute.m_DelayTime); TaskSystem.Task singTask = new TaskSystem.Task(" 蓄力任务", singCond); m_tm.AddTask(singTask); m_tm.Start(que01, delegate() { Debug.Log(que01 + "队列结束********************************************"); for (int i = 0; i < skill.Attribute.m_BuffList.Count; i++) { WsTaskManager wtm = new WsTaskManager(); Buff b = skill.Attribute.m_BuffList[i]; TimeCondition singCond3 = new TimeCondition(b.m_DelayTime); TaskSystem.Task singTask3 = new TaskSystem.Task("A buff延迟任务" + (i + 1), singCond3); wtm.AddTask(singTask3); wtm.Start(" buff延迟队列>" + (i + 1), delegate() { //Debug.Log(" buff延迟队列结束>" + (i + 1)); Debug.Log("buff延迟任务队列结束********************************************"); WsTaskManager wtm2 = new WsTaskManager(); string tn = "B buff生效任务:" + b.m_BuffName; BuffCondition bc = new BuffCondition(b, b.m_BuffTime); //Debug.Log(tn); TaskSystem.Task tbc = new TaskSystem.Task(tn, bc); wtm2.AddTask(tbc); wtm2.Start("000 buff队列>" + (i + 1), delegate() { Debug.Log("buff队列队列结束********************************************"); b.RemoveBuff(); }); }); } }); }
public static Task<IEnumerable<TransitDescription>> GetTransitDirections(GeoCoordinate startPoint, GeoCoordinate endPoint, DateTime dateTime, TimeCondition timeType) { var transitDescriptions = new List<TransitDescription>(); return GetBingTransitDirections(startPoint, endPoint, dateTime, timeType).ContinueWith( googleContinuation => { return GetBingWalkingDirections(startPoint, endPoint).ContinueWith( bingContinuation => { if (googleContinuation.IsCompleted) { transitDescriptions.AddRange(googleContinuation.Result); } if (bingContinuation.IsCompleted) { transitDescriptions.AddRange(bingContinuation.Result); } return transitDescriptions.AsEnumerable(); }); }).Unwrap(); }
static void Main(string[] args) { // create instance of NLService using (NLService svc = new NLService()) { try { // connect to NL service on local machine svc.Connect(); } catch (Exception e) { Console.WriteLine("Connect exception: {0}", e.Message); return; } Filter fltWhole; if (null == (fltWhole = svc.Filters.Find(x => x.Name == "Test-WholeMachineExceptSystemServices"))) { // create a filter for whole computer, but by-pass system services - all "system" and svchost.exe processes fltWhole = new Filter("Test-WholeMachineExceptSystemServices"); FFPathEqual fnc1 = new FFPathEqual(); fnc1.IsMatch = false; // catch all traffic that DOESN'T match the value fnc1.Values.Add(@"system"); // system process fnc1.Values.Add(@"c:\windows\system32\svchost.exe"); // path - it could be different on your machine fltWhole.Functions.Add(fnc1); svc.AddFilter(fltWhole); fltWhole = svc.Filters.Find(x => x.Name == "Test-WholeMachineExceptSystemServices"); // NOTE: If you create a filter without any filter functions, then it will catch all traffic on the machine // read more about filters here: https://www.netlimiter.com/docs/basic-concepts/filters } LimitRule limWhole = null; List <Rule> ruleWholeList; if (null == (ruleWholeList = svc.Rules.FindAll(x => x.FilterId == fltWhole.Id)) || ruleWholeList.Count == 0) { limWhole = new LimitRule(RuleDir.In, 200000); // create limit rule (size in Bytes per second) limWhole.IsEnabled = true; // create Start/Stop conditions - limit is activated every day at 12PM and deactivated at 18PM TimeCondition cndStartLimitWhole = new TimeCondition(); cndStartLimitWhole.Action = RuleConditionAction.Start; cndStartLimitWhole.TimeConditionType = TimeConditionType.EveryDay; cndStartLimitWhole.Time = new DateTime(2019, 1, 1, 12, 0, 0); TimeCondition cndStopLimitWhole = new TimeCondition(); cndStopLimitWhole.Action = RuleConditionAction.Stop; cndStopLimitWhole.TimeConditionType = TimeConditionType.EveryDay; cndStopLimitWhole.Time = new DateTime(2019, 1, 1, 18, 0, 0); limWhole.Conditions.Add(cndStartLimitWhole); limWhole.Conditions.Add(cndStopLimitWhole); // add the rule to NetLimiter system limWhole = svc.AddRule(fltWhole.Id, limWhole) as LimitRule; // load all rules for the filter ruleWholeList = svc.Rules.FindAll(x => x.FilterId == fltWhole.Id); } else {// rules for our filter already exist foreach (var r in ruleWholeList) { Console.WriteLine("Rule (Filter: {0}) - id: {1} ", r.FilterId, r.Id); } } Console.WriteLine("A test Filter and rule were created. Check NetLimiter if they created correctly."); Console.WriteLine("Press ENTER to delete the filter, delete the rule and Exit."); Console.ReadLine(); // remove rules foreach (var r in ruleWholeList) { svc.RemoveRule(r); } // remove filter svc.RemoveFilter(fltWhole); } }
public override int GetHashCode() { int hash = 1; if (BrokerId.Length != 0) { hash ^= BrokerId.GetHashCode(); } if (InvestorId.Length != 0) { hash ^= InvestorId.GetHashCode(); } if (UserId.Length != 0) { hash ^= UserId.GetHashCode(); } if (InstrumentId.Length != 0) { hash ^= InstrumentId.GetHashCode(); } if (ExchangeId.Length != 0) { hash ^= ExchangeId.GetHashCode(); } if (OrderPriceType != 0) { hash ^= OrderPriceType.GetHashCode(); } if (Direction != 0) { hash ^= Direction.GetHashCode(); } if (CombOffsetFlag != 0) { hash ^= CombOffsetFlag.GetHashCode(); } if (CombHedgeFlag != 0) { hash ^= CombHedgeFlag.GetHashCode(); } if (LimitPrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(LimitPrice); } if (VolumeTotalOriginal != 0) { hash ^= VolumeTotalOriginal.GetHashCode(); } if (TimeCondition != 0) { hash ^= TimeCondition.GetHashCode(); } if (VolumeCondition != 0) { hash ^= VolumeCondition.GetHashCode(); } if (MinVolume != 0) { hash ^= MinVolume.GetHashCode(); } if (ContigentCondition != 0) { hash ^= ContigentCondition.GetHashCode(); } if (StopPrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(StopPrice); } if (ForceCloseReason != 0) { hash ^= ForceCloseReason.GetHashCode(); } if (IsAutoSuspend != 0) { hash ^= IsAutoSuspend.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
/// <summary> /// TimeCondition枚举型转为TThostFtdcTimeConditionType枚举型 /// </summary> /// <param name="tc">TimeCondition枚举型</param> /// <returns></returns> public static TThostFtdcTimeConditionType TimeCondition_To_TThostFtdcTimeConditionType(TimeCondition tc) { TThostFtdcTimeConditionType tftct = TThostFtdcTimeConditionType.THOST_FTDC_TC_GFD; switch (tc) { case TimeCondition.GFD: break; case TimeCondition.IOC: tftct = TThostFtdcTimeConditionType.THOST_FTDC_TC_IOC; break; case TimeCondition.GFS: tftct = TThostFtdcTimeConditionType.THOST_FTDC_TC_GFS; break; case TimeCondition.GTD: tftct = TThostFtdcTimeConditionType.THOST_FTDC_TC_GTD; break; case TimeCondition.GTC: tftct = TThostFtdcTimeConditionType.THOST_FTDC_TC_GTC; break; case TimeCondition.GFA: tftct = TThostFtdcTimeConditionType.THOST_FTDC_TC_GFA; break; default: break; } return(tftct); }
void GenerateAnswer() { // Getting a random track _chosenTrackName = _shortTrackNames[rnd.Range(0, _shortTrackNames.Length)]; // Getting the Vehicle int carIndex = (_bomb.GetSerialNumberNumbers().Last() + _bomb.GetBatteryCount()) * (DoesSerialContain("AEIOU".ToCharArray()) ? _bomb.GetPortPlateCount() : _bomb.GetBatteryHolderCount()); _chosenCarName = _carNames[carIndex % 22]; // Getting the Direction of the Track if (_bomb.GetSerialNumberNumbers().Last() % 2 == 1) // Last digit is odd { if (_bomb.GetPorts().Distinct().Count() != _bomb.GetPortCount()) // Repeated ports { if (_bomb.GetBatteryCount() % 2 == 0) // Batteries Even { _trackInReverse = true; } else // Otherwise { _trackInReverse = false; } } else // Otherwise { if (_bomb.GetOnIndicators().Count() > _bomb.GetOffIndicators().Count()) // Lit Indicators > Unlit Indicators { _trackInReverse = false; } else // Otherwise { _trackInReverse = true; } } } else // Otherwise { if (_bomb.GetPorts().Distinct().Count() != _bomb.GetPortCount()) // Repeated Ports { if (_bomb.GetBatteryCount() % 2 == 0) // Batteries Even { _trackInReverse = false; } else // Otherwise { _trackInReverse = true; } } else // Otherwise { if (_bomb.GetOnIndicators().Count() % 2 == 0) // Even amount of lit Indicators { _trackInReverse = true; } else { _trackInReverse = false; } } } // Getting the Condition of the track Debug.LogFormat("[Burnout #{0}]: On try #{1}, the information is: ", _modID, _tryAmount); if (DoesSerialContain("D3ST7".ToCharArray())) { Debug.LogFormat("[Burnout #{0}]: The serial number contains a character from 'D3ST7', the track condition is 'UNSAFE'.", _modID); _chosenCondition = TrackCondition.UNSAFE; } else { _chosenCondition = GetTrackCondition(); } // Getting the Boost Multiplier if (_bomb.GetBatteryCount() > _bomb.GetIndicators().Count()) { _chosenBoostAmount = 2; } else if (_bomb.GetOnIndicators().Any(x => x == "FRK")) { _chosenBoostAmount = 4; } else if (_chosenCondition == TrackCondition.RAINY) { _chosenBoostAmount = 1; } else { _chosenBoostAmount = 3; } // Getting the Time Condition if (Array.IndexOf(_carNames, _chosenCarName).EqualsAny(0, 1, 2, 3, 4, 5, 6)) { _chosenTimeRestraint = TimeCondition.CARINDEX; } else if (Array.IndexOf(_carNames, _chosenCarName).EqualsAny(7, 8, 9, 10, 11, 12, 13)) { _chosenTimeRestraint = TimeCondition.FIRSTSERIAL; } else { _chosenTimeRestraint = TimeCondition.INDIPLATES; } // Checking for overrides if ((_bomb.GetPortPlateCount() == 0 || _bomb.GetPortPlates().All(x => x.Length != 0)) && _bomb.GetOffIndicators().Count() == 0 && PortIsPresent(Port.PS2) && DoesSerialContain("C4TE6".Select(x => x).ToArray())) { Debug.LogFormat("[Burnout #{0}]: No empty port plates, no unlit indicators, PS/2 port is present and serial contains a character from 'C4TE6'. Overriding car to 'Drivers ED', the track condition to 'UNSAFE' and the time condition to 'NONE'.", _modID); _chosenCarName = "Drivers ED"; _chosenCondition = TrackCondition.UNSAFE; _chosenTimeRestraint = TimeCondition.NONE; } if (ModuleIdIsPresent("NeedyBeer") && _bomb.GetBatteryHolderCount() >= 4) { Debug.LogFormat("[Burnout #{0}]: 'Refill that Beer!' needy is present as well as 4 battery holders. Overriding car to 'Pickup', boost amount to '1' and time condition to 'NONE'.", _modID); _chosenCarName = "Pickup"; _chosenBoostAmount = 1; _chosenTimeRestraint = TimeCondition.NONE; } if (_trackInReverse && _chosenCarName == "Touring Car") { if (ModuleIdIsPresent("FlagsModule") || ModuleIdIsPresent("needyFlagIdentification")) { Debug.LogFormat("[Burnout #{0}]: Module wants to be solved at the end of the bomb.", _modID); _fullBomb = true; } else { Debug.LogFormat("[Burnout #{0}]: Module wants to be solved for over half solves.", _modID); _halfBomb = true; } } if (_chosenCarName == "Race car" && _bomb.GetBatteryCount() == 3) { _immediately = true; Debug.LogFormat("[Burnout #{0}]: Module wants to be solved immediately.", _modID); } // Selecting the condition order if (_chosenCarName.EqualsAny("Super", "Custom") || _trackInReverse) { _conditionOrder = new int[] { 2, 1, 0 }; } else if (_chosenCarName.EqualsAny("Compact", "Cop car")) { _conditionOrder = new int[] { 2, 0, 1 }; } else { _conditionOrder = new int[] { 0, 1, 2 }; } _currentCondition = _conditionOrder[0]; Debug.LogFormat("[Burnout #{0}]: The chosen track, car name and condition is: {1}, {2} and {3}, respectively.", _modID, _chosenTrackName, _chosenCarName, _chosenCondition.ToString()); Debug.LogFormat("[Burnout #{0}]: The direction of the track is {1}.", _modID, _trackInReverse ? "in reverse" : "normal"); Debug.LogFormat("[Burnout #{0}]: The chosen boost amount is {1}.", _modID, _chosenBoostAmount); Debug.LogFormat("[Burnout #{0}]: The desired order for all conditions to be entered is {1}.", _modID, _conditionOrder.Select(x => new string[] { "Track Condition", "Car", "Boost Amount" }[x]).ToArray().Join(", ")); Debug.LogFormat("[Burnout #{0}]: The chosen time to boost at is {1} and release when {2}.", _modID, _chosenTimeRestraint == TimeCondition.CARINDEX ? Array.IndexOf(_carNames, _chosenCarName).ToString() : _chosenTimeRestraint == TimeCondition.FIRSTSERIAL ? _bomb.GetSerialNumberNumbers().First().ToString() : _chosenTimeRestraint == TimeCondition.INDIPLATES ? (_bomb.GetPortPlateCount() + _bomb.GetIndicators().Count()).ToString() : _chosenTimeRestraint == TimeCondition.NONE ? "whenever" : "whenever", _chosenTimeRestraint == TimeCondition.CARINDEX ? "the seconds digits are a multiple of 3" : _chosenTimeRestraint == TimeCondition.FIRSTSERIAL ? "the last second digit is a multiple of 2" : _chosenTimeRestraint == TimeCondition.INDIPLATES ? "either of the seconds digits is equal to the amount of battery holders" : _chosenTimeRestraint == TimeCondition.NONE ? "whenever" : "whenever"); _displayTexts[0].text = _chosenTrackName; _tryAmount++; }
public void EnsureDateTimeSyncInContext(TimeCondition timeType) { this.TimeType = timeType; if (this.TimeType == TimeCondition.Now) { this.DateTime = DateTime.Now; } }
private static Task<IEnumerable<TransitDescription>> GetGoogleTransitDirections(GeoCoordinate startPoint, GeoCoordinate endPoint, DateTime dateTime, TimeCondition timeType) { bool isDepartureTime = timeType == TimeCondition.Now || timeType == TimeCondition.DepartingAt; return GoogleMapsQuery.GetTransitRoute(startPoint, endPoint, dateTime, isDepartureTime).ContinueWith( continuation => { var result = continuation.Result; if (result.Error == null) { return result.Response.routes.Select(route => new TransitDescription(route, TransitDescription.DirectionType.Transit)); } return new List<TransitDescription>(); }); }
private void fillCondition(TimeCondition timeCondition) { fillOperator(timeCondition, timeOperator); timeCondition.Time = time.Text; }