private async Task ProcessMessageAsync(ExecutionEvent message) { if (message.Header.MessageType != MessageType.Order) { return; } try { string walletId = await _settingsService.GetWalletIdAsync(); Order[] orders = message.Orders .Where(o => o.WalletId == walletId) .Where(o => o.Side != OrderSide.UnknownOrderSide) .Where(o => o.Trades?.Count > 0) .ToArray(); var trades = new List <Trade>(); foreach (Order order in orders) { if (order.Status == OrderStatus.Matched || order.Status == OrderStatus.PartiallyMatched || order.Status == OrderStatus.Cancelled) { IReadOnlyList <Trade> orderExecutionReports = GetTrades(order); trades.AddRange(orderExecutionReports); } } if (trades.Any()) { foreach (var trade in trades) { await _tradeService.RegisterAsync(trade); await _summaryReportService.RegisterTradeAsync(trade); } _log.InfoWithDetails("Traders were handled", trades); } } catch (Exception exception) { _log.Error(exception, "An error occurred during processing trades", message); } }
/** * Notify a list of listeners that a sample has occurred. * * @param res * the sample event that has occurred. Must be non-null. * @param listeners * a list of the listeners which should be notified. This list * must not be null and must contain only SampleListener * elements. */ public void notifyListeners(ExecutionEvent res, List <ExecutionListener> listeners) { foreach (ExecutionListener sampleListener in listeners) { try { TestBeanHelper.prepare((TestElement)sampleListener); sampleListener.ExecutionOccurred(res); } catch (Exception e) { //log.error("Detected problem in Listener: ", e); //log.info("Continuing to process further listeners"); } } }
protected override void DoExecute(ExecutionEvent executionEvent) { _projectId = executionEvent.GetFirstSelectedTreeNavigationItem().ProjectId; try { ProgressCounter progressCounter = new ProgressCounter("Generate", "Generating the CSV files...", 1); LongRunningJob <GenerateDto> projectCreationJob = new LongRunningJob <GenerateDto>(GenerateAction, progressCounter); projectCreationJob.AddAction(delegate { _generateWindow.Dispatcher.Invoke(AfterGenerateAction, DispatcherPriority.Normal); }); projectCreationJob.Execute(_generateDto); } catch (Exception ex) { OnFailure(executionEvent); } }
private static string GetExecutionName(ExecutionEvent executionEvent) { switch (executionEvent?.Id) { case 0: case null: return((string)Application.Current.Resources["Immediately"]); case 1: return((string)Application.Current.Resources["DateAndTime"]); case 2: return((string)Application.Current.Resources["Idle"]); default: return((string)Application.Current.Resources["Unknown"]); } }
protected override FolderDto CreateNewDto(ExecutionEvent executionEvent) { FolderDto folderDto = base.CreateNewDto(executionEvent); folderDto.State = State.NEW; TreeNavigationItem selectedTreeNavigationItem = executionEvent.GetFirstSelectedTreeNavigationItem(); if (NavigationType.PROJECT.Equals(selectedTreeNavigationItem.Type)) { folderDto.ProjectId = selectedTreeNavigationItem.Id; folderDto.ParentId = null; } else { folderDto.ProjectId = selectedTreeNavigationItem.ProjectId; folderDto.ParentId = selectedTreeNavigationItem.Id; } return(folderDto); }
public void OnExecuteButton(ExecutionEvent cmpEv) { if (!Remote) { if (_currentlyCompilingCode && _lastCompiledScript != null) { _lastCompiledScript.Execute(); } else if (_currentlyCompilingCoroutine && _lastCompiledCoroutine != null) { StartCoroutine(_lastCompiledCoroutine.GetEnumerator()); } } else { if (_currentlyCompilingCode) { _engineRemote.ExecuteLastCompiledCode(); } } }
private async Task ProcessMessageAsync(ExecutionEvent message) { var trades = new List <TradeEntity>(); foreach (var order in message.Orders) { var orderEntity = _mapper.Map <OrderEntity>(order); if (order.Trades == null) { continue; } foreach (var trade in order.Trades) { var tradeEntity = _mapper.Map <TradeEntity>(trade); tradeEntity.AssetPairId = orderEntity.AssetPairId; tradeEntity.OrderId = orderEntity.Id; tradeEntity.PartitionKey = orderEntity.WalletId; tradeEntity.WalletId = orderEntity.WalletId; trades.Add(tradeEntity); } } var tradesByWallet = trades.GroupBy(x => x.WalletId); var tasks = new List <Task>(); foreach (var walletTrades in tradesByWallet) { var tradeUpdate = new TradeUpdate(); tradeUpdate.Trades.AddRange(_mapper.Map <List <Lykke.HftApi.ApiContract.Trade> >(walletTrades.ToList())); tasks.Add(_tradeStream.WriteToStreamAsync(tradeUpdate, walletTrades.Key)); } await Task.WhenAll(tasks); }
private Task ProcessMessage(ExecutionEvent evt) { _log.Info("Processing execution event", evt); foreach (var order in evt.Orders) { switch (order.OrderType) { case OrderType.Market: var marketOrder = ToOldMarketOrder(order); _cqrsEngine.SendCommand( new Commands.CreateTradeCommand { QueueMessage = marketOrder }, BoundedContexts.TxHandler, BoundedContexts.Trades); break; case OrderType.Limit: case OrderType.StopLimit: var limitOrder = ToOldLimitOrder(order); _cqrsEngine.SendCommand( new ProcessLimitOrderCommand { LimitOrder = limitOrder }, BoundedContexts.TxHandler, BoundedContexts.TxHandler); break; default: throw new NotSupportedException($"Order type {order.OrderType} is not supported"); } } return(Task.CompletedTask); }
protected override void DoExecute(ExecutionEvent executionEvent) { Connection.GetInstance().CloseConnection(); OnSuccessful(executionEvent, Guid.Empty); }
private void OnCopyCommand(object obj) { HandlerExecutor.Execute <CopyHandler>(ExecutionEvent.Create(obj as List <TreeNavigationItem>)); }
private async Task ProcessMessageAsync(ExecutionEvent message) { if (message.Header.MessageType != MessageType.Order) { return; } string walletId = _settingsService.GetWalletId(); Order[] orders = message.Orders .Where(o => o.WalletId == walletId) .ToArray(); if (orders.Any()) { _log.InfoWithDetails("Lykke trades received", message); } orders = orders .Where(o => o.Side != OrderSide.UnknownOrderSide) .Where(o => o.Trades?.Count > 0) .ToArray(); if (orders.Any()) { try { var internalTrades = new List <InternalTrade>(); foreach (Order order in orders) { // The limit order fully executed. The remaining volume is zero. if (order.Status == OrderStatus.Matched) { internalTrades.AddRange(Map(order, true)); } // The limit order partially executed. if (order.Status == OrderStatus.PartiallyMatched) { internalTrades.AddRange(Map(order, false)); } // The limit order was cancelled by matching engine after processing trades. // In this case order partially executed and remaining volume is less than min volume allowed by asset pair. if (order.Status == OrderStatus.Cancelled) { internalTrades.AddRange(Map(order, true)); } } await Task.WhenAll(_internalTradeHandlers.Select(o => o.HandleInternalTradesAsync(internalTrades))); _log.InfoWithDetails("Lykke trades handled", internalTrades); } catch (Exception exception) { _log.ErrorWithDetails(exception, "An error occurred while processing trades", orders); throw; } } }
private Task ProcessMessageAsync(ExecutionEvent message) { var orders = message.Orders.Select(x => new OrderModel { Id = Guid.Parse(x.ExternalId), WalletId = Guid.Parse(x.WalletId), Volume = decimal.Parse(x.Volume), AssetPairId = x.AssetPairId, CreateDt = x.CreatedAt, LowerLimitPrice = ParseNullabe(x.LowerLimitPrice), LowerPrice = ParseNullabe(x.LowerPrice), MatchDt = x.LastMatchTime, MatchingId = Guid.Parse(x.Id), Price = ParseNullabe(x.Price), RegisterDt = x.Registered, RejectReason = x.RejectReason, RemainingVolume = ParseNullabe(x.RemainingVolume), Side = (Contracts.Cqrs.Models.Enums.OrderSide)(int) x.Side, Status = (Contracts.Cqrs.Models.Enums.OrderStatus)(int) x.Status, StatusDt = x.StatusDate, Straight = x.OrderType == OrderType.Limit || x.OrderType == OrderType.StopLimit || x.Straight, Type = (Contracts.Cqrs.Models.Enums.OrderType)(int) x.OrderType, UpperLimitPrice = ParseNullabe(x.UpperLimitPrice), UpperPrice = ParseNullabe(x.UpperPrice), Trades = x.Trades?.Select(t => new TradeModel { Id = Guid.Parse(t.TradeId), WalletId = Guid.Parse(x.WalletId), AssetPairId = x.AssetPairId, BaseAssetId = t.BaseAssetId, BaseVolume = decimal.Parse(t.BaseVolume), Price = decimal.Parse(t.Price), Timestamp = t.Timestamp, QuotingAssetId = t.QuotingAssetId, QuotingVolume = decimal.Parse(t.QuotingVolume), Index = t.Index, Role = (Contracts.Cqrs.Models.Enums.TradeRole)(int) t.Role, FeeSize = ParseNullabe(t.Fees?.FirstOrDefault()?.Volume), FeeAssetId = t.Fees?.FirstOrDefault()?.AssetId, OppositeWalletId = Guid.Parse(t.OppositeWalletId), }).ToList() }).ToList(); foreach (var order in orders.Where(x => _walletIds.Contains(x.WalletId.ToString()))) { _log.Info("Order from ME", $"order: {new {order.Id, order.Status, message.Header.SequenceNumber}.ToJson()}"); } var @event = new ExecutionProcessedEvent { SequenceNumber = message.Header.SequenceNumber, Orders = orders }; _cqrsEngine.PublishEvent(@event, BoundedContext.Name); foreach (var order in orders.Where(x => x.Trades != null && x.Trades.Any())) { var tradeProcessedEvent = new ManualOrderTradeProcessedEvent { Order = order }; _cqrsEngine.PublishEvent(tradeProcessedEvent, BoundedContext.Name); } foreach (var order in message.Orders.Where(x => x.Trades != null && x.Trades.Count > 0)) { var orderType = order.OrderType == OrderType.Market ? FeeOperationType.Trade : FeeOperationType.LimitTrade; var orderId = order.Id; foreach (var trade in order.Trades) { if (trade.Fees != null) { var feeEvent = new FeeChargedEvent { OperationId = orderId, OperationType = orderType, Fee = trade.Fees.ToJson() }; _cqrsEngine.PublishEvent(feeEvent, BoundedContext.Name); } } } var limitOrders = orders.Where(x => x.Type == Contracts.Cqrs.Models.Enums.OrderType.Limit || x.Type == Contracts.Cqrs.Models.Enums.OrderType.StopLimit).ToList(); foreach (var order in limitOrders.Where(x => x.Status == OrderStatus.Cancelled)) { var orderCancelledEvent = new OrderCancelledEvent { OrderId = order.Id, Status = order.Status, AssetPairId = order.AssetPairId, Price = order.Price, Timestamp = order.StatusDt, Volume = order.Volume, WalletId = order.WalletId }; _cqrsEngine.PublishEvent(orderCancelledEvent, BoundedContext.Name); } foreach (var order in limitOrders.Where(x => x.Status == OrderStatus.Placed)) { var orderPlacedEvent = new OrderPlacedEvent { OrderId = order.Id, Status = order.Status, AssetPairId = order.AssetPairId, Price = order.Price, Timestamp = order.StatusDt, Volume = order.Volume, WalletId = order.WalletId, CreateDt = order.CreateDt }; _cqrsEngine.PublishEvent(orderPlacedEvent, BoundedContext.Name); } foreach (var order in limitOrders.Where(x => (x.Status == OrderStatus.Matched || x.Status == OrderStatus.PartiallyMatched) && x.Trades.Any(t => t.Role == TradeRole.Taker))) { var orderPlacedEvent = new OrderPlacedEvent { OrderId = order.Id, Status = order.Status, AssetPairId = order.AssetPairId, Price = order.Price, Timestamp = order.StatusDt, Volume = order.Volume, WalletId = order.WalletId, CreateDt = order.CreateDt }; _cqrsEngine.PublishEvent(orderPlacedEvent, BoundedContext.Name); } return(Task.CompletedTask); }
protected override void OnFailure(ExecutionEvent executionEvent) { Log.Error("Error during the code generating"); }
protected override void OnSuccessful(ExecutionEvent executionEvent, Guid affectedObjectId) { Publisher.GetInstance().Publish(PublishEvent.CreateCreationEvent(IdConstants.PRESET_FOLDER_ID, executionEvent.GetFirstSelectedTreeNavigationItem().Id)); }
Map(ExecutionEvent executionEvent) { var orders = new List <Antares.Service.History.Core.Domain.Orders.Order>(executionEvent.Orders.Count); foreach (var x in executionEvent.Orders) { Antares.Service.History.Core.Domain.Orders.Order order; try { order = new Antares.Service.History.Core.Domain.Orders.Order { Id = Guid.Parse(x.ExternalId), WalletId = Guid.Parse(x.WalletId), Volume = decimal.Parse(x.Volume), AssetPairId = x.AssetPairId, CreateDt = x.CreatedAt, LowerLimitPrice = ParseNullabe(x.LowerLimitPrice), LowerPrice = ParseNullabe(x.LowerPrice), MatchDt = x.LastMatchTime, MatchingId = Guid.Parse(x.Id), Price = ParseNullabe(x.Price), RegisterDt = x.Registered, RejectReason = x.RejectReason, RemainingVolume = ParseNullabe(x.RemainingVolume) ?? 0m, Side = (Antares.Service.History.Core.Domain.Enums.OrderSide)(int) x.Side, Status = (Antares.Service.History.Core.Domain.Enums.OrderStatus)(int) x.Status, StatusDt = x.StatusDate, Straight = x.OrderType == Lykke.MatchingEngine.Connector.Models.Events.OrderType.Limit || x.OrderType == Lykke.MatchingEngine.Connector.Models.Events.OrderType.StopLimit || x.Straight, SequenceNumber = executionEvent.Header.SequenceNumber, Type = (Antares.Service.History.Core.Domain.Enums.OrderType)(int) x.OrderType, UpperLimitPrice = ParseNullabe(x.UpperLimitPrice), UpperPrice = ParseNullabe(x.UpperPrice), }; order.Trades = x.Trades == null ? Array.Empty <Antares.Service.History.Core.Domain.History.Trade>() : x.Trades.Select(t => new Antares.Service.History.Core.Domain.History.Trade() { Id = Guid.Parse(t.TradeId), WalletId = Guid.Parse(x.WalletId), AssetPairId = x.AssetPairId, BaseAssetId = t.BaseAssetId, BaseVolume = decimal.Parse(t.BaseVolume), Price = decimal.Parse(t.Price), Timestamp = t.Timestamp, QuotingAssetId = t.QuotingAssetId, QuotingVolume = decimal.Parse(t.QuotingVolume), Index = t.Index, Role = (Antares.Service.History.Core.Domain.Enums.TradeRole)(int) t.Role, FeeSize = ParseNullabe(t.Fees?.FirstOrDefault()?.Volume), FeeAssetId = t.Fees?.FirstOrDefault()?.AssetId, OrderId = order.Id //OppositeWalletId = Guid.Parse(t.OppositeWalletId), }).ToArray(); orders.Add(order); } catch (Exception ex) { _log.Error(ex, "Can't convert execution event to order", context: $"execution event: {x.ToJson()}"); } } foreach (var order in orders.Where(x => _walletIds.Contains(x.WalletId.ToString()))) { _log.Info("Order from ME", $"order: {new { order.Id, order.Status, executionEvent.Header.SequenceNumber }.ToJson()}"); } var limitOrders = orders.Where(x => x.Type == Antares.Service.History.Core.Domain.Enums.OrderType.Limit || x.Type == Antares.Service.History.Core.Domain.Enums.OrderType.StopLimit).ToList(); var historyOrders = new List <OrderEvent>(limitOrders.Count); foreach (var order in limitOrders) { switch (order.Status) { case Service.History.Core.Domain.Enums.OrderStatus.Cancelled: { var orderEvent = new OrderEvent { OrderId = order.Id, Status = order.Status, AssetPairId = order.AssetPairId, Price = order.Price ?? 0, Timestamp = order.StatusDt, Volume = order.Volume, WalletId = order.WalletId, Id = Utils.IncrementGuid(order.Id, (int)Service.History.Core.Domain.Enums.OrderStatus.Cancelled) }; historyOrders.Add(orderEvent); break; } case Service.History.Core.Domain.Enums.OrderStatus.Placed: { var orderEvent = new OrderEvent { OrderId = order.Id, Status = order.Status, AssetPairId = order.AssetPairId, Price = order.Price ?? 0, Timestamp = order.CreateDt, Volume = order.Volume, WalletId = order.WalletId, Id = Utils.IncrementGuid(order.Id, (int)Service.History.Core.Domain.Enums.OrderStatus.Placed) }; historyOrders.Add(orderEvent); break; } case Service.History.Core.Domain.Enums.OrderStatus.Matched: case Service.History.Core.Domain.Enums.OrderStatus.PartiallyMatched: { if (!order.Trades.Any(t => t.Role == Service.History.Core.Domain.Enums.TradeRole.Taker)) { break; } var orderEvent = new OrderEvent() { OrderId = order.Id, Status = Service.History.Core.Domain.Enums.OrderStatus.Placed, AssetPairId = order.AssetPairId, Price = order.Price ?? 0, Timestamp = order.CreateDt, Volume = order.Volume, WalletId = order.WalletId, Id = Utils.IncrementGuid(order.Id, (int)Service.History.Core.Domain.Enums.OrderStatus.Placed) }; historyOrders.Add(orderEvent); break; } default: continue; } } return(orders, historyOrders); }
private void OnGenerateLiquibaseCommand(object obj) { HandlerExecutor.Execute <GenerateLiquibaseHandler>(ExecutionEvent.Create(obj as List <TreeNavigationItem>)); }
/** * Accumulates the sample in two SampleResult objects - one for running * totals, and the other for deltas. * * @see org.apache.jmeter.samplers.SampleListener#sampleOccurred(org.apache.jmeter.samplers.SampleEvent) */ public void ExecutionOccurred(ExecutionEvent e) { ExecuteResult s = e.getResult(); Int64 now = DateTime.Now.Ticks;// in seconds RunningSample myDelta = null; RunningSample myTotal = null; Boolean reportNow = false; /* * Have we reached the reporting boundary? * Need to allow for a margin of error, otherwise can miss the slot. * Also need to check we've not hit the window already */ Monitor.Enter(myTotals); try { if (s != null) { myTotals.delta.AddSample(s); } if ((now > myTotals.last + INTERVAL_WINDOW) && (now % INTERVAL <= INTERVAL_WINDOW)) { reportNow = true; // copy the data to minimise the synch time myDelta = new RunningSample(myTotals.delta); myTotals.MoveDelta(); myTotal = new RunningSample(myTotals.total); myTotals.last = now; // stop double-reporting } } finally { Monitor.Exit(myTotals); } if (reportNow) { String str; str = Format(myName, myDelta, "+"); if (TOLOG) { log.Info(str); } if (TOCONSOLE) { System.Console.WriteLine(str); } // Only if we have updated them if (myTotal != null && myDelta != null && myTotal.getNumSamples() != myDelta.getNumSamples()) { str = Format(myName, myTotal, "="); if (TOLOG) { log.Info(str); } if (TOCONSOLE) { System.Console.WriteLine(str); } } } }
public Task <bool> ExecuteCommand(StaticCommand staticCommand, TransmissionEvent transmissionEvent, ExecutionEvent executionEvent, StopEvent stopEvent, List <Condition> conditions, CommandTarget target) { return(Task.FromResult(true)); }
protected override void OnFailure(ExecutionEvent executionEvent) { Log.Error("Error during the closing the project"); }
public ExecutionStatusChangedEventArgs(string path, ExecutionEvent e) { _path = path; _conversionEvent = e; }
protected override void OnSuccessful(ExecutionEvent executionEvent, Guid affectedObjectId) { Publisher.GetInstance().ServerChanged(null); ProjectProvider.GetInstance().SetProjectActive(false); }
public void ExecuteCommand(StaticCommand staticCommand, TransmissionEvent transmissionEvent, ExecutionEvent executionEvent, List <Condition> conditions, CommandTarget target) { if (conditions != null && conditions.Count == 0) { conditions = null; } _serverConnection.SendCommand(new DynamicCommand { CommandId = staticCommand.CommandId, Target = target, Conditions = conditions, TransmissionEvent = transmissionEvent, ExecutionEvent = executionEvent, CommandParameter = staticCommand.GetCommandParameter().Data, PluginHash = null }); }
protected override void DoExecute(ExecutionEvent executionEvent) { WindowsManager.GetInstance().ShowDialog <GenerateCodeWindow>(new GenerateCodeWindowModelView(executionEvent.GetFirstSelectedTreeNavigationItem())); OnSuccessful(executionEvent, Guid.Empty); }
private void OnNewCompmositeTypeElementCommand(object obj) { HandlerExecutor.Execute <NewCompositeTypeElementHandler>(ExecutionEvent.Create(obj as List <TreeNavigationItem>)); }
protected override void OnSuccessful(ExecutionEvent executionEvent, Guid affectedObjectId) { Log.Info("Code generating was success"); }
protected override void OnFailure(ExecutionEvent executionEvent) { Log.Error("Error during the set the default to the entity"); }
public bool Execute(Interactuable interactuable, ExecutionEvent callback = null) { // In case any menu is shown, we hide it MenuMB.Instance.hide(true); // Then we execute anything if (executeStack.Count == 0 || executeStack.Peek().Key != interactuable) { Debug.Log("Pushed " + interactuable.ToString()); executeStack.Push(new KeyValuePair <Interactuable, ExecutionEvent>(interactuable, callback)); } while (executeStack.Count > 0) { var preInteractSize = executeStack.Count; var toExecute = executeStack.Peek(); var requiresMore = false; try { requiresMore = toExecute.Key.Interacted() == InteractuableResult.REQUIRES_MORE_INTERACTION; } catch (System.Exception ex) { Debug.LogError("Interacted execution exception: " + ex.Message + ex.StackTrace); } if (requiresMore) { uAdventureRaycaster.Instance.Override = this.gameObject; return(true); } else { Debug.Log("Execution finished " + toExecute.ToString()); if (preInteractSize != executeStack.Count) { Debug.Log("The size was different"); var backupStack = new Stack <KeyValuePair <Interactuable, ExecutionEvent> >(); // We backup the new stacked things while (executeStack.Count > preInteractSize) { backupStack.Push(executeStack.Pop()); } // Then we remove our entry executeStack.Pop(); // Then we reinsert the backuped stuff while (backupStack.Count > 0) { executeStack.Push(backupStack.Pop()); } } else { executeStack.Pop(); } try { if (toExecute.Value != null) { toExecute.Value(toExecute.Key); } } catch (System.Exception ex) { Debug.Log("Execution OnFinished execution exception: " + ex.Message); } } } uAdventureRaycaster.Instance.Override = null; return(false); }
protected override WizardModelView <ProjectDto> CreateWizardModelView(ExecutionEvent executionEvent) { return(new NewProjectModelView(CreateNewDto(executionEvent))); }
public bool Execute(Interactuable interactuable, ExecutionEvent callback = null) { // In case any menu is shown, we hide it if (MenuMB.Instance) { MenuMB.Instance.hide(true); } if (executeStack.Count == 0) { AutoSave(); } // Then we execute anything if (executeStack.Count == 0 || executeStack.Peek().Key != interactuable) { Debug.Log("Pushed " + interactuable.ToString()); executeStack.Push(new KeyValuePair <Interactuable, ExecutionEvent>(interactuable, callback)); } while (executeStack.Count > 0) { var preInteractSize = executeStack.Count; var toExecute = executeStack.Peek(); var requiresMore = false; try { requiresMore = toExecute.Key.Interacted() == InteractuableResult.REQUIRES_MORE_INTERACTION; } catch (System.Exception ex) { Debug.LogError("Interacted execution exception: " + ex.Message + ex.StackTrace); } if (requiresMore && !actionCanceled) { uAdventureRaycaster.Instance.Override = this.gameObject; return(true); } else { Debug.Log("Execution finished " + toExecute.ToString()); if (!actionCanceled) { if (preInteractSize != executeStack.Count) { Debug.Log("The size was different"); var backupStack = new Stack <KeyValuePair <Interactuable, ExecutionEvent> >(); // We backup the new stacked things while (executeStack.Count > preInteractSize) { backupStack.Push(executeStack.Pop()); } // Then we remove our entry executeStack.Pop(); // Then we reinsert the backuped stuff while (backupStack.Count > 0) { executeStack.Push(backupStack.Pop()); } } else { executeStack.Pop(); } } try { if (actionCanceled) { while (executeStack.Count > 0) { var removed = executeStack.Pop(); if (removed.Value != null) { removed.Value(removed.Key); } } } else if (toExecute.Value != null) { toExecute.Value(toExecute.Key); } } catch (System.Exception ex) { Debug.Log("Execution OnFinished execution exception: " + ex.Message); if (actionCanceled) { executeStack.Clear(); } } } } if (uAdventureRaycaster.Instance) { uAdventureRaycaster.Instance.Override = null; } if (executeStack.Count == 0) { if (GameState.ChangeAmbitCount > 0) { Debug.LogWarning("There are still some opened change ambits! " + GameState.ChangeAmbitCount); } OnActionCanceled = null; AutoSave(); } // In case any bubble is bugged GUIManager.Instance.DestroyBubbles(); actionCanceled = false; return(false); }
protected virtual void OnExecutionStatusChanged(string path, ExecutionEvent e) { ExecutionStatusChanged?.Invoke(this, new ExecutionStatusChangedEventArgs(path, e)); }