public void Initialize(EndEvent evt) { gameObject.SetActive(true); myScore.text = evt.primaryBatteryCost.ToString(); opponentScore.text = evt.secondaryBatteryCost.ToString(); timeText.text = "Number of turns: " + evt.turnCount; }
public StartTurnOffPageDialogLogic(IPageDialogPresenter presenter) { this.presenter = presenter; avm = new AuthorizationViewModel(); avm.AuthorizationEndEvent += (user) => { Statics.CurrentUser.Instance.User = user; EndEvent?.Invoke(PageDialogResult.Completed); }; avm.RegistrationRequiredEvent += () => { if (rvm == null) { rvm = new RegistrationViewModel(); rvm.CancelEvent += () => { presenter.ShowPage(avm); }; rvm.RegistrationCompleteEvent += () => { presenter.ShowPage(avm); }; } presenter.ShowPage(rvm); }; }
public static void initEndEvent(BpmnModelInstance modelInstance, string endEventId) { EndEvent endEvent = modelInstance.getModelElementById(endEventId); TerminateEventDefinition terminateDefinition = modelInstance.newInstance(typeof(TerminateEventDefinition)); endEvent.addChildElement(terminateDefinition); }
void Start() { if (ToCam == null) { ToCam = Camera.main; } onPress += (go, state) => { Open = state; if (state) { StartV2 = GetV2(Input.mousePosition); StartEvent.Invoke(); } else { if (!Out) { EndEvent.Invoke(); } else { Father.onPress(Father.gameObject, false); } Out = false; } }; }
public void Tick() { switch (CurrentData.direction) { case MoveDirection.x: from.position = from.position.XLerp(CurrentData.pos, speed); break; case MoveDirection.y: from.position = from.position.YLerp(CurrentData.pos, speed); break; case MoveDirection.z: from.position = from.position.ZLerp(CurrentData.pos, speed); break; } if (Distance() < Tolerance) { if (queue.Count == 0) { AnilUpdate.Tasks.Remove(this); EndEvent?.Invoke(); return; } CurrentData = queue.Dequeue(); if (isPlus) { CurrentData.Add(CurrentValue()); } } }
public override object Clone() { var result = new EndEvent(); FeedCatchEvent(result); return(result); }
public override BaseFlowNode Build() { var result = new EndEvent(); FeedCatchEvt(result); return(result); }
/// <summary> /// Used to handle model property updates /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void UpdateProperty(object sender, PropertyChangedEventArgs e) { PropertyChanged?.Invoke(this, e); // If the user reaches the end, end the game if (e.PropertyName == "LocalPosition" && LocalPosition == EndPos) { Model.ServerUpdateEvent -= HandleServerMessage; Application.Current.Dispatcher.Invoke(() => { EndEvent?.Invoke(true); }); Model.Close(); } // If the enemy reaches the end, end the game else if (e.PropertyName == "EnemyPosition" && EnemyPosition == EndPos) { Model.ServerUpdateEvent -= HandleServerMessage; Application.Current.Dispatcher.Invoke(() => { EndEvent?.Invoke(false); }); Model.Close(); } // If the maze is update; enable the user inputs else if (e.PropertyName == "Maze") { Application.Current.Dispatcher.Invoke(() => { MazeLoaded?.Invoke(); }); } }
public void Show() { Start(); BeginPlay(); if (BeginEvent != null) { BeginEvent.Invoke(); } DogCall(); PersonCall(); WindCall(); Funny(); if (HighEvent != null) { HighEvent.Invoke(); } EndPlay(); GetCharge(); if (EndEvent != null) { EndEvent.Invoke(); } }
private IEnumerator EndLevel() { yield return(new WaitForSeconds(2.0f)); _audioSource.pitch = 1.2f + Random.value * 0.2f; _audioSource.PlayOneShot(FanfareClip, 1.0f); yield return(new WaitForSeconds(3.0f)); LightController light = Light.GetComponent <LightController>(); light.SetEnabled(true); EndEvent?.Invoke(this, null); yield return(new WaitForSeconds(3.0f)); Dart[] darts = FindObjectsOfType <Dart>(); foreach (Dart dart in darts) { GameObject dartObject = dart.gameObject; // FIXME: Should be destroyed rather than deactivated. //GameObject.Destroy(dartObject); dartObject.SetActive(false); } GameObject.Destroy(_levelObject); yield return(new WaitForSeconds(0.5f)); GoToNextLevel(); }
public void RegisterEndEvent() { EndEvent ev = new EndEvent(id); TrackEvent(ev); //Clear? }
public SequenceFlow(JToken process, StartEvent startEvent, EndEvent endEvent, ExpressionContext context) { _process = process; _startEvent = startEvent; _endEvent = endEvent; _context = context; _currentFlowId = _startEvent.Outgoing; }
protected internal override BaseElement ConvertXMLToElement(XMLStreamReader xtr, BpmnModel model) { EndEvent endEvent = new EndEvent(); BpmnXMLUtil.AddXMLLocation(endEvent, xtr); ParseChildElements(XMLElementName, endEvent, model, xtr); return(endEvent); }
static EndEvent CreateEndEvent(XElement xElement) { var endEvent = new EndEvent(); FillCommonProcessElementAttributes(endEvent, xElement); return(endEvent); }
static EndEvent CreateEndEvent(XElement xElement) { var endEvent = new EndEvent(); endEvent.Id = GetProcessId(xElement); return(endEvent); }
public virtual EndEvent CreateEndEvent() { var endEvent = new EndEvent(); //endEvent.Tag = new EndEventActivityBehavior(); return(endEvent); }
public override BaseElement Clone() { EndEvent clone = new EndEvent { Values = this }; return(clone); }
/// <summary> /// 结束整个流程 /// </summary> public void End() { _currentContent = null; _currentTarget = null; _running = false; _executing = false; EndEvent?.Invoke(); }
protected virtual void InvokeAnimationCompleted() { EndEvent handler = OnAnimationCompleted; if (handler != null) { OnAnimationCompleted.Invoke(); } }
public void StartDialog() { EditTaskViewModel etvm = new EditTaskViewModel(currentTask); etvm.EditResult += (res) => { EndEvent?.Invoke(res); }; presenter.ShowPage(etvm); }
public BpmnProcess(string bpmn) { var doc = XDocument.Parse(bpmn); Context = new ExpressionContext(); o = JObject.Parse(JsonConvert.SerializeXNode(doc)); process = o["bpmn:definitions"]["bpmn:process"]; Id = process["@id"].Value <string>(); StartEvent = new StartEvent(process); EndEvent = new EndEvent(process); SequenceFlow = new SequenceFlow(process, StartEvent, EndEvent, Context); }
/// <summary> /// 结束任务流程 /// </summary> public void End() { _currentStepIndex = 0; _currentContent = null; _currentTarget = null; _currentHelper = null; _running = false; _pause = false; _executing = false; EndEvent?.Invoke(); }
internal override List <ComponentLine> BuildLines() { List <ComponentLine> lines = new List <ComponentLine>(); lines.Add(new ComponentLine("SUMMARY:", Summary.Coalesce(Description.ToDescriptionString(), "Onbekend").ToSummary())); if (IsAllDayEvent) { lines.Add(new ComponentLine("DTSTART;VALUE=DATE:", StartEvent.ToCalendarDateUTC())); lines.Add(new ComponentLine("DTEND;VALUE=DATE:", EndEvent.ToCalendarDateUTC())); } else { var tz = new ComponentPart("TZID", TimeZone.ToOlsonName()); lines.Add(new ComponentLine($"DTSTART;{tz}:", StartEvent, false)); lines.Add(new ComponentLine($"DTEND;{tz}:", EndEvent, false)); } DateTime now = DateTime.Now; //lines.Add(new ComponentLine("DTSTAMP:", now, true)); lines.Add(new ComponentLine("UID:", $"{Code}@icalendarAPI")); //lines.Add(new ComponentLine("CLASS:", Class)); //lines.Add(new ComponentLine("CATEGORIES:", Categories)); lines.Add(new ComponentLine("STATUS:", Status)); //lines.Add(new ComponentLine("TRANSP:", Transparancy)); lines.Add(new ComponentLine("LOCATION:", Location.ToPascalCase())); //lines.Add(new ComponentLine("URL:", UrlNormalization.Instance.Normalize(Url))); //lines.Add(new ComponentLine("LAST-MODIFIED:", LastModified.Coalesce(now), true)); //lines.Add(new ComponentLine("CREATED:", now, true)); lines.Add(new ComponentLine("SEQUENCE:", Sequence)); //lines.Add(new ComponentLine("DESCRIPTION:", Description.ToDescriptionString())); //lines.Add(new ComponentLine("PRIORITY:", Priority.ForceToRange<int>(0, 9))); //lines.Add(new ComponentLine("RESOURCES:", Resources)); //lines.Add(new ComponentLine("REQUEST-STATUS:", RequestStatus)); //lines.Add(new ComponentLine("X-ALT-DESC;FMTTYPE=text/html:", string.Empty)); //Description.ToHtml(true, 30) //lines.Add(new ComponentLine("X-MICROSOFT-CDO-BUSYSTATUS:", MicrosoftBusyStatus.Busy)); //lines.Add(new ComponentLine("X-MICROSOFT-CDO-IMPORTANCE:", (int)MS_CDO_Importance.Normal)); lines.AddRange(Attachments.Select(attachment => attachment.BuildLine())); //if (!string.IsNullOrEmpty(Description) || !string.IsNullOrEmpty(HtmlDescription)) // output.AppendLine("X-ALT-DESC;" + FileMimeType.Html.ToCalendarString() + ";" + HtmlDescription.ToHtmlString(true).Coalesce(Description.ToHtml())); if (Alarm != null) { lines.AddRange(Alarm.BuildLines()); } return(BuildComponent(lines)); }
private void GoToNextLevel() { ++LevelIndex; if (LevelIndex >= LevelPrefabs.Length) { LevelIndex = 0; } if (LevelIndex == 0) { TotalScore = 0; EndEvent?.Invoke(this, null); } LoadLevel(LevelIndex); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void createProcessWithOneTask() public virtual void createProcessWithOneTask() { // create process Process process = createElement(definitions, "process-with-one-task", typeof(Process)); // create elements StartEvent startEvent = createElement(process, "start", typeof(StartEvent)); UserTask task1 = createElement(process, "task1", typeof(UserTask)); EndEvent endEvent = createElement(process, "end", typeof(EndEvent)); // create flows createSequenceFlow(process, startEvent, task1); createSequenceFlow(process, task1, endEvent); }
/// <summary> /// Identifies the step to follow the given step. /// </summary> /// <param name="elementId">The id of the current process element. Usually a task.</param> /// <returns>The id of the next step.</returns> public List <string> NextElements(string elementId) { if (elementId == null) { throw new ArgumentNullException(nameof(elementId)); } List <string> elementIds = new List <string>(); string currentStepId = null; ProcessTask currentTask = definitions.Process.Tasks.Find(task => task.Id == elementId); if (currentTask != null) { currentStepId = currentTask.Id; } if (currentStepId == null) { StartEvent startEvent = definitions.Process.StartEvents.Find(se => se.Id == elementId); if (startEvent != null) { currentStepId = startEvent.Id; } } if (currentStepId == null) { throw new ProcessException($"Unable to find a start event or task using element id {elementId}."); } foreach (SequenceFlow sequenceFlow in definitions.Process.SequenceFlow.FindAll(s => s.SourceRef == currentStepId)) { ProcessTask task = definitions.Process.Tasks.Find(t => t.Id == sequenceFlow.TargetRef); if (task != null) { elementIds.Add(task.Id); continue; } EndEvent endEvent = definitions.Process.EndEvents.Find(e => e.Id == sequenceFlow.TargetRef); if (endEvent != null) { elementIds.Add(endEvent.Id); continue; } } return(elementIds); }
public void PostFault(TelemetryIdentifier telemetryIdentifier, string description, Exception exception) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (telemetryIdentifier == null) { throw new ArgumentNullException("telemetryIdentifier"); } FaultEvent val = (FaultEvent)(object)new FaultEvent(telemetryIdentifier.Value, description, exception, (Func <IFaultUtility, int>)SendFaultToWatson); EndEvent.Correlate(((TelemetryEvent)val).Correlation); TelemetryRecorder.RecordEvent((TelemetryEvent)(object)val); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Before public void parseModel() public virtual void parseModel() { modelInstance = Bpmn.readModelFromStream(this.GetType().getResourceAsStream(this.GetType().Name + ".xml")); collaboration = modelInstance.getModelElementById(COLLABORATION_ID); participant = modelInstance.getModelElementById(PARTICIPANT_ID + 1); process = modelInstance.getModelElementById(PROCESS_ID + 1); serviceTask = modelInstance.getModelElementById(SERVICE_TASK_ID); exclusiveGateway = modelInstance.getModelElementById(EXCLUSIVE_GATEWAY); startEvent = modelInstance.getModelElementById(START_EVENT_ID + 2); sequenceFlow = modelInstance.getModelElementById(SEQUENCE_FLOW_ID + 3); messageFlow = modelInstance.getModelElementById(MESSAGE_FLOW_ID); dataInputAssociation = modelInstance.getModelElementById(DATA_INPUT_ASSOCIATION_ID); association = modelInstance.getModelElementById(ASSOCIATION_ID); endEvent = modelInstance.getModelElementById(END_EVENT_ID + 2); }
public void StartDialog() { SelectUserViewModel suvm = new SelectUserViewModel(); suvm.UserResult += (result) => { if (result) { var user = suvm.SelectedUser; if (currentTask.Performers.FirstOrDefault(p => p.User.ID == user.ID) != null) { MessageBox.Show("Пользователь " + user.FIO + " уже есть в списке исполнителей."); presenter.ShowPage(suvm); } else { ResolutionAndDateViewModel rdvm = new ResolutionAndDateViewModel(); rdvm.PerfomerResult += (res) => { if (res == PageDialogResult.Canceled) { EndEvent?.Invoke(res); } else { currentTask.Performers.Add(new Performer() { User = user, Message = rdvm.Message, PeriodOfExecution = rdvm.Period, WorkTask = currentTask }); if (DB.TaskDataBase.Instance.SafeSaveChanges()) { EndEvent?.Invoke(res); } } }; presenter.ShowPage(rdvm); } } else { EndEvent?.Invoke(PageDialogResult.Canceled); } }; presenter.ShowPage(suvm); }
public void PostFault(TelemetryIdentifier telemetryIdentifier, string description, IEnumerable <DataPoint> properties) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) if (telemetryIdentifier == null) { throw new ArgumentNullException("telemetryIdentifier"); } FaultEvent val = (FaultEvent)(object)new FaultEvent(telemetryIdentifier.Value, description, (Exception)null, (Func <IFaultUtility, int>)null); DataPointCollection.AddCollectionToDictionary(properties, ((TelemetryEvent)val).Properties); EndEvent.Correlate(((TelemetryEvent)val).Correlation); TelemetryRecorder.RecordEvent((TelemetryEvent)(object)val); }
// Update is called once per frame void Update () { if (i >= text_sequence.Length) return; t += Time.unscaledDeltaTime; // Unaffected by pause! if (t > interval) { t = 0.0f; i++; if (i < text_sequence.Length) { //im.sprite = sequence[i]; txt.text = text_sequence[i]; } else { // Countdown's over! if (onEnd != null) { onEnd(); // And reset the delegate onEnd = null; } //im.enabled = false; txt.enabled = false; } } if (i < text_sequence.Length) { float sc = scale.Evaluate(t / interval); //im.color = new Color(1, 1, 1, alpha.Evaluate(t / interval)); txt.color = new Color(col.r, col.g, col.b, alpha.Evaluate(t / interval)); transform.localScale = Vector3.one * sc; } }