public static bool IsTheSame(ActionData a , ActionData b) { return a.gameObjectsNames == b.gameObjectsNames && a.gameObjects == b.gameObjects && a.strings == b.strings && a.strings == b.strings; }
public override void Process(ActionData actionData) { var priceTag = actionData.GetAsString("PriceTag"); var departmentName = actionData.GetAsString("DepartmentName"); _departmentService.UpdatePriceTag(departmentName, priceTag); _methodQueue.Queue("ResetCache", () => Helper.ResetCache(_triggerService, _applicationState)); }
public override void Process(ActionData actionData) { var entityId = actionData.GetDataValueAsInt("EntityId"); var entityName = actionData.GetAsString("EntityName"); var fieldName = actionData.GetAsString("FieldName"); var value = actionData.GetAsString("FieldValue"); if (entityId > 0) { _entityServiceClient.UpdateEntityData(entityId, fieldName, value); } else if (!string.IsNullOrEmpty(entityName)) { var entityTypeName = actionData.GetAsString("EntityTypeName"); var entityType = _cacheService.GetEntityTypeByName(entityTypeName); if (entityType != null) { _entityServiceClient.UpdateEntityData(entityType, entityName, fieldName, value); } } else { var ticket = actionData.GetDataValue<Ticket>("Ticket"); if (ticket != null) { var entityTypeName = actionData.GetAsString("EntityTypeName"); foreach (var ticketEntity in ticket.TicketEntities) { var entityType = _cacheService.GetEntityTypeById(ticketEntity.EntityTypeId); if (string.IsNullOrEmpty(entityTypeName.Trim()) || entityType.Name == entityTypeName) _entityServiceClient.UpdateEntityData(ticketEntity.EntityId, fieldName, value); } } } }
public override void Process(ActionData actionData) { var ticket = actionData.GetDataValue<Ticket>("Ticket"); var orderTagName = actionData.GetAsString("OrderTagName"); if (ticket != null && !string.IsNullOrEmpty(orderTagName)) { var orderTagValue = actionData.GetAsString("OrderTagValue"); if (ticket.Orders.Any(y => y.OrderTagExists(z => z.TagName == orderTagName && z.TagValue == orderTagValue))) { var tid = ticket.Id; EventServiceFactory.EventService.PublishEvent(EventTopicNames.CloseTicketRequested, true); ticket = _ticketService.OpenTicket(tid); var orders = ticket.Orders.Where(y => y.OrderTagExists(z => z.TagName == orderTagName && z.TagValue == orderTagValue)).ToArray(); var commitResult = _ticketService.MoveOrders(ticket, orders, 0); if (string.IsNullOrEmpty(commitResult.ErrorMessage) && commitResult.TicketId > 0) { ExtensionMethods.PublishIdEvent(commitResult.TicketId, EventTopicNames.DisplayTicket); } else { ExtensionMethods.PublishIdEvent(tid, EventTopicNames.DisplayTicket); } } } }
public override void Process(ActionData actionData) { var entityTypeName = actionData.GetAsString("EntityTypeName"); var entityName = actionData.GetAsString("EntityName"); var createAccount = actionData.GetAsBoolean("CreateAccount"); var customData = actionData.GetAsString("CustomData"); if (!string.IsNullOrEmpty(entityTypeName) && !string.IsNullOrEmpty(entityName)) { var entityType = _cacheService.GetEntityTypeByName(entityTypeName); var entity = _entityService.CreateEntity(entityType.Id, entityName); if (customData.Contains(":")) { foreach (var parts in customData.Split('#').Select(data => data.Split('='))) entity.SetCustomData(parts[0], parts[1]); } if (createAccount) { var accountName = entityType.GenerateAccountName(entity); var accountId = _accountService.CreateAccount(entityType.AccountTypeId, accountName); entity.AccountId = accountId; actionData.DataObject.AccountName = accountName; } _entityService.SaveEntity(entity); actionData.DataObject.EntityName = entity.Name; } }
public override void Process(ActionData actionData) { var fileName = actionData.GetAsString("FileName"); var arguments = actionData.GetAsString("Arguments"); if (!string.IsNullOrEmpty(fileName)) { var psi = new ProcessStartInfo(fileName, arguments); var isHidden = actionData.GetAsBoolean("IsHidden"); if (isHidden) psi.WindowStyle = ProcessWindowStyle.Hidden; var useShellExecute = actionData.GetAsBoolean("UseShellExecute"); if (useShellExecute) psi.UseShellExecute = true; var workingDirectory = actionData.GetAsString("WorkingDirectory"); if (!string.IsNullOrEmpty(workingDirectory)) psi.WorkingDirectory = workingDirectory; try { System.Diagnostics.Process.Start(psi); } catch (Exception e) { _logService.LogError(e, string.Format("Start Process action [{0}] generated an error. See log file for details.", actionData.Action.Name)); } } }
public void NotifyEvent(string eventName, object dataParameter, int terminalId, int departmentId, int userRoleId, int ticketTypeId, Action<ActionData> dataAction) { var dataObject = dataParameter.ToDynamic(); _settingService.ClearSettingCache(); var rules = _cacheService.GetAppRules(eventName, terminalId, departmentId, userRoleId, ticketTypeId); foreach (var rule in rules.Where(x => string.IsNullOrEmpty(x.EventConstraints) || SatisfiesConditions(x, dataObject))) { if (!CanExecuteRule(rule, dataObject)) continue; foreach (var actionContainer in rule.Actions.OrderBy(x => x.SortOrder).Where(x => CanExecuteAction(x, dataObject))) { var container = actionContainer; var action = _cacheService.GetActions().Single(x => x.Id == container.AppActionId); var clonedAction = ObjectCloner.Clone(action); var containerParameterValues = container.ParameterValues ?? ""; _settingService.ClearSettingCache(); clonedAction.Parameter = _settingService.ReplaceSettingValues(clonedAction.Parameter); containerParameterValues = _settingService.ReplaceSettingValues(containerParameterValues); containerParameterValues = ReplaceParameterValues(containerParameterValues, dataObject); clonedAction.Parameter = _expressionService.ReplaceExpressionValues(clonedAction.Parameter, dataObject); containerParameterValues = _expressionService.ReplaceExpressionValues(containerParameterValues, dataObject); var data = new ActionData { Action = clonedAction, DataObject = dataObject, ParameterValues = containerParameterValues }; dataAction.Invoke(data); } } }
public override void Process(ActionData actionData) { var ticket = actionData.GetDataValue<Ticket>("Ticket"); var orders = Helper.GetOrders(actionData, ticket); if (orders.Any()) { var tagName = actionData.GetAsString("OrderTagName"); var orderTag = _cacheService.GetOrderTagGroupByName(tagName); if (orderTag != null) { var tagValue = actionData.GetAsString("OrderTagValue"); var oldTagValue = actionData.GetAsString("OldOrderTagValue"); var tagNote = actionData.GetAsString("OrderTagNote"); var orderTagValue = orderTag.OrderTags.SingleOrDefault(y => y.Name == tagValue); if (orderTagValue != null) { if (!string.IsNullOrEmpty(actionData.GetAsString("OrderTagPrice"))) { var price = actionData.GetAsDecimal("OrderTagPrice"); orderTagValue.Price = price; } if (!string.IsNullOrEmpty(oldTagValue)) orders = orders.Where(o => o.OrderTagExists(y => y.OrderTagGroupId == orderTag.Id && y.TagValue == oldTagValue)).ToList(); if (actionData.Action.ActionType == ActionNames.TagOrder) _ticketService.TagOrders(ticket, orders, orderTag, orderTagValue, tagNote); if (actionData.Action.ActionType == ActionNames.UntagOrder) _ticketService.UntagOrders(ticket, orders, orderTag, orderTagValue); } } } }
public override void Process(ActionData actionData) { var ticket = actionData.GetDataValue<Ticket>("Ticket"); var orders = Helper.GetOrders(actionData, ticket); if (orders.Any()) { foreach (var order in orders) { if (!string.IsNullOrEmpty(actionData.GetAsString("Quantity"))) order.Quantity = actionData.GetAsDecimal("Quantity"); if (!string.IsNullOrEmpty(actionData.GetAsString("Price"))) order.UpdatePrice(actionData.GetAsDecimal("Price"), ""); if (!string.IsNullOrEmpty(actionData.GetAsString("IncreaseInventory"))) order.IncreaseInventory = actionData.GetAsBoolean("IncreaseInventory"); if (!string.IsNullOrEmpty(actionData.GetAsString("DecreaseInventory"))) order.DecreaseInventory = actionData.GetAsBoolean("DecreaseInventory"); if (!string.IsNullOrEmpty(actionData.GetAsString("Locked"))) order.Locked = actionData.GetAsBoolean("Locked"); if (!string.IsNullOrEmpty(actionData.GetAsString("CalculatePrice"))) order.CalculatePrice = actionData.GetAsBoolean("CalculatePrice"); if (!string.IsNullOrEmpty(actionData.GetAsString("AccountTransactionType"))) _ticketService.ChangeOrdersAccountTransactionTypeId(ticket, new List<Order> { order }, _cacheService.GetAccountTransactionTypeIdByName (actionData.GetAsString("AccountTransactionType"))); if (!string.IsNullOrEmpty(actionData.GetAsString("PortionName")) || !string.IsNullOrEmpty(actionData.GetAsString("PriceTag"))) { var portionName = actionData.GetAsString("PortionName"); var priceTag = actionData.GetAsString("PriceTag"); _ticketService.UpdateOrderPrice(order, portionName, priceTag); } } } }
public static IList<Order> GetOrders(ActionData x, Ticket ticket) { IList<Order> orders = new List<Order>(); var selectedOrder = x.GetDataValue<Order>("Order"); if (selectedOrder != null && ticket != null && selectedOrder.SelectedQuantity > 0 && selectedOrder.SelectedQuantity != selectedOrder.Quantity) { selectedOrder = ticket.ExtractSelectedOrder(selectedOrder); x.DataObject.Order = selectedOrder; } if (selectedOrder == null) { if (ticket != null) { orders = ticket.Orders.Any(y => y.IsSelected) ? ticket.ExtractSelectedOrders().ToList() : ticket.Orders; x.DataObject.Order = null; } } else orders.Add(selectedOrder); return orders; }
public override void Process(ActionData actionData) { var ticket = actionData.GetDataValue<Ticket>("Ticket"); if (ticket != null) { var menuItemName = actionData.GetAsString("MenuItemName"); var menuItem = _cacheService.GetMenuItem(y => y.Name == menuItemName); var portionName = actionData.GetAsString("PortionName"); var quantity = actionData.GetAsDecimal("Quantity"); var tag = actionData.GetAsString("Tag"); var orderStateName = actionData.GetAsString("OrderStateName"); var orderState = actionData.GetAsString("OrderState"); var osv = orderState.Contains("=") ? orderState : orderStateName + "=" + orderState; var order = _ticketService.AddOrder(ticket, menuItem.Id, quantity, portionName, osv); if (!string.IsNullOrEmpty(actionData.GetAsString("Price"))) order.UpdatePrice(actionData.GetAsDecimal("Price"), ""); if (!string.IsNullOrEmpty(actionData.GetAsString("IncreaseInventory"))) order.IncreaseInventory = actionData.GetAsBoolean("IncreaseInventory"); if (!string.IsNullOrEmpty(actionData.GetAsString("DecreaseInventory"))) order.DecreaseInventory = actionData.GetAsBoolean("DecreaseInventory"); if (!string.IsNullOrEmpty(actionData.GetAsString("Locked"))) order.Locked = actionData.GetAsBoolean("Locked"); if (!string.IsNullOrEmpty(actionData.GetAsString("CalculatePrice"))) order.CalculatePrice = actionData.GetAsBoolean("CalculatePrice"); if (order != null) order.Tag = tag; actionData.DataObject.Order = order; order.PublishEvent(EventTopicNames.OrderAdded); } }
public override void Process(ActionData actionData) { var ticketId = actionData.GetAsInteger("TicketId"); var ticket = _ticketService.OpenTicket(ticketId); actionData.DataObject.Ticket = ticket; ticket.PublishEvent(EventTopicNames.SetSelectedTicket); }
public override void Process(ActionData actionData) { var entityId = actionData.GetDataValueAsInt("EntityId"); var entityTypeId = actionData.GetDataValueAsInt("EntityTypeId"); var stateName = actionData.GetAsString("EntityStateName"); var state = actionData.GetAsString("EntityState"); var quantityExp = actionData.GetAsString("QuantityExp"); if (state != null) { if (entityId > 0 && entityTypeId > 0) { _entityServiceClient.UpdateEntityState(entityId, entityTypeId, stateName, state, quantityExp); } else { var ticket = actionData.GetDataValue<Ticket>("Ticket"); if (ticket != null) { var entityTypeName = actionData.GetAsString("EntityTypeName"); foreach (var ticketEntity in ticket.TicketEntities) { var entityType = _cacheService.GetEntityTypeById(ticketEntity.EntityTypeId); if (string.IsNullOrEmpty(entityTypeName.Trim()) || entityType.Name == entityTypeName) _entityServiceClient.UpdateEntityState(ticketEntity.EntityId, ticketEntity.EntityTypeId, stateName, state, quantityExp); } } } } }
public override void Process(ActionData actionData) { var ticket = actionData.GetDataValue<Ticket>("Ticket"); if (ticket != null && ticket != Ticket.Empty && CanCloseTicket(ticket)) { EventServiceFactory.EventService.PublishEvent(EventTopicNames.CloseTicketRequested, true); } }
public override void Process(ActionData actionData) { var ticket = actionData.GetDataValue<Ticket>("Ticket"); if (ticket != null) { CommonEventPublisher.EnqueueTicketEvent(EventTopicNames.SelectAutomationCommand); } }
public override void Process(ActionData actionData) { var ticket = actionData.GetDataValue<Ticket>("Ticket"); if (ticket != null && ticket.Orders.Count > 0) { actionData.DataObject.Order = ticket.Orders.Last(); } }
public override void Process(ActionData actionData) { var ticket = actionData.GetDataValue<Ticket>("Ticket"); if (ticket != null) { ticket.RequestLock(); } }
public override void Process(ActionData actionData) { var ticket = actionData.GetDataValue<Ticket>("Ticket"); if (ticket != null) { ticket.PublishEvent(EventTopicNames.DisplayTicketLog); } }
public override void Process(ActionData actionData) { var script = actionData.GetAsString("ScriptName"); if (!string.IsNullOrEmpty(script)) { _expressionService.EvalCommand(script, "", actionData.DataObject, true); } }
public override void Process(ActionData actionData) { var ticket = actionData.GetDataValue<Ticket>("Ticket"); if (ticket != null && ticket != Ticket.Empty && _ticketService.CanSettleTicket(ticket)) { ticket.PublishEvent(EventTopicNames.MakePayment); } }
public override void Process(ActionData actionData) { var ticket = actionData.GetDataValue<Ticket>("Ticket"); if (ticket != null) { ticket.StopActiveTimers(); } }
/// <summary> /// 游戏结束 /// </summary> public void gameEnd() { gameBegin = false; beginTime = 0; lastUpdateViewStatus = null; //lastActionViewStatus = null; actionData = null; }
/// <summary> /// Execute the action. /// </summary> /// <param name="obj">The object executing the action.</param> public override void Execute(GameObject obj, ActionData data = new ActionData()) { if (moveOther) { obj.transform.position = pos; } else { gameObject.transform.position = pos; } }
public SystemAction(ActionType type, ActionData actionData) : base(Enums.ActionTypeId.SystemAction) { _actionData = actionData; _type = type; Details.Add(type.ToString()); Details.Add(_actionData.TargetVar); //1 }
public override void Process(ActionData actionData) { var screenName = actionData.GetAsString("AccountScreenName"); var screen = _cacheService.GetAccountScreens().FirstOrDefault(x => x.Name == screenName); if (screen != null) { _reportServiceClient.PrintAccountScreen(screen); } }
public ActionData(ActionData actionData) { this.type = actionData.type; this.damage = actionData.damage; this.executeTime = actionData.executeTime; this.actionTime = actionData.actionTime; this.isFromPlayer = actionData.isFromPlayer; this.typeChosen = actionData.typeChosen; }
public override void Process(ActionData actionData) { var ticket = actionData.GetDataValue<Ticket>("Ticket"); if ((ticket == null || ticket == Ticket.Empty) && actionData.GetAsBoolean("CanCreateTicket") && !_applicationState.IsLocked) { ticket = _ticketService.OpenTicket(0); actionData.DataObject.Ticket = ticket; ticket.PublishEvent(EventTopicNames.SetSelectedTicket); } if (ticket != null) { var entityTypeName = actionData.GetAsString("EntityTypeName"); var entityName = actionData.GetAsString("EntityName"); var customDataSearchValue = actionData.GetAsString("EntitySearchValue"); var entityType = _cacheService.GetEntityTypeByName(entityTypeName); if (entityType != null) { if (string.IsNullOrEmpty(entityName) && string.IsNullOrEmpty(customDataSearchValue)) { CommonEventPublisher.PublishEntityOperation(Entity.GetNullEntity(entityType.Id), EventTopicNames.SelectEntity, EventTopicNames.EntitySelected); return; } Entity entity = null; if (!string.IsNullOrEmpty(customDataSearchValue)) { var entities = _entityService.SearchEntities(entityType, customDataSearchValue, null); if (entities.Count == 1) { entity = entities.First(); } } if (entity == null) { entity = _cacheService.GetEntityByName(entityTypeName, entityName); } if (entity == null && string.IsNullOrEmpty(entityName) && string.IsNullOrEmpty(customDataSearchValue)) { entity = Entity.GetNullEntity(entityType.Id); } if (entity != null) { _ticketService.UpdateEntity(ticket, entity); actionData.DataObject.EntityName = entity.Name; actionData.DataObject.EntityId = entity.Id; actionData.DataObject.CustomData = entity.CustomData; } } } }
protected static List<CASAGSAvailabilityFlags> GetSettings(ActionData data) { SeasonSettings.ActionDataSetting settings = Retuner.SeasonSettings.GetSettings(data, false); if (settings != null) { List<CASAGSAvailabilityFlags> result; if (settings.GetTargetAgeSpecies(out result)) return result; } return Retuner.AgeSpeciesToList(data.TargetAgeSpeciesAllowed); }
public MessageAction(ActionType type, ActionData actionData) : base(Enums.ActionTypeId.MessageBox) { _actionData = actionData; _type = type; Details.Add(type.ToString()); Details.Add(_actionData.Message); //1 Details.Add(_actionData.TimeOut); //2 }
public LabelAction(ActionType type, ActionData actionData) : base(Enums.ActionTypeId.Lable) { _actionData = actionData; _type = type; Details.Add(type.ToString()); Details.Add(_actionData.LableName); Details.Add(_actionData.Loops); }
// standardized what happens on confirm action public ActionResult Received(String actionGuid) { using (var e = new EntityContext()) { var data = ActionData.GetAction <DataModel>(Guid.Parse(actionGuid), e); var model = data.Item1; var actionRow = data.Item2; if (model == null || actionRow == null || actionRow.Investigator_Name == null) { return(View(ResetPasswordErrorView)); } model.Guid = actionGuid; //e.Web_Action_Data.Remove(actionRow); //e.SaveChanges(); return(View(ReceivedView, model)); } }
public FsmState(FsmState source) { fsm = source.Fsm; name = source.Name; description = source.description; colorIndex = source.colorIndex; position = new Rect(source.position); hideUnused = source.hideUnused; isBreakpoint = source.isBreakpoint; isSequence = source.isSequence; transitions = new FsmTransition[source.transitions.Length]; for (int i = 0; i < source.Transitions.Length; i++) { transitions[i] = new FsmTransition(source.Transitions[i]); } actionData = source.actionData.Copy(); }
// this function is called when the EnemyUnit needs to know what it's going to do // it evaluates its possibleActions, selects the best one, and asks it to create ActionData to store public void NewActionData() { if (possibleActions.Count != 0) { // get data about the board-state, possible options, etc if (GetImmobilizedDuration() > 0 || GetDisabledDuration() > 0) { MoveableTiles = new Dictionary <Vector2Int, Direction>(); MoveableTiles.Add(GetMapPosition(), Direction.NO_DIR); } else { MoveableTiles = FindMoveableTiles(MapController.instance.weightedMap); } foreach (AbilityOption option in possibleAbilities) { option.EvaluateAffectableTiles(); } EnemyAction bestAction = null; float highestSignificance = 0.0f; // for each possible action: foreach (EnemyAction action in possibleActions) { // evaluate its significance level action.Evaluate(); // check if it currently has the highest significance if (action.GetSignificance() > highestSignificance) { bestAction = action; highestSignificance = action.GetSignificance(); } } plannedActionData = bestAction.GetActionData(); // This useful Debug statement will print to the console the details of what this Unit committed to doing Debug.Log(this.GetName() + " at Starting Position " + this.GetMapPosition() + " has committed to moving to " + plannedActionData.GetEndingPosition() + " and using " + this.AvailableAbilities[plannedActionData.GetAbilityIndex()] + " in direction " + plannedActionData.GetAbilityDirection()); } }
public void removeAction(string actionId) { ActionData fd = null; foreach (ActionData d in actionsData) { if (d.actionId == actionId) { fd = d; } } if (fd != null) { actionsData.Remove(fd); } writeDatabase(); }
public override void Process(ActionData actionData) { var ticket = actionData.GetDataValue <Ticket>("Ticket"); if (ticket != null) { var menuItemName = actionData.GetAsString("MenuItemName"); var menuItem = _cacheService.GetMenuItem(y => y.Name == menuItemName); var portionName = actionData.GetAsString("PortionName"); var quantity = actionData.GetAsDecimal("Quantity"); var tag = actionData.GetAsString("Tag"); var orderStateName = actionData.GetAsString("OrderStateName"); var orderState = actionData.GetAsString("OrderState"); var osv = orderState.Contains("=") ? orderState : orderStateName + "=" + orderState; var order = _ticketService.AddOrder(ticket, menuItem.Id, quantity, portionName, osv); if (!string.IsNullOrEmpty(actionData.GetAsString("Price"))) { order.UpdatePrice(actionData.GetAsDecimal("Price"), ""); } if (!string.IsNullOrEmpty(actionData.GetAsString("IncreaseInventory"))) { order.IncreaseInventory = actionData.GetAsBoolean("IncreaseInventory"); } if (!string.IsNullOrEmpty(actionData.GetAsString("DecreaseInventory"))) { order.DecreaseInventory = actionData.GetAsBoolean("DecreaseInventory"); } if (!string.IsNullOrEmpty(actionData.GetAsString("Locked"))) { order.Locked = actionData.GetAsBoolean("Locked"); } if (!string.IsNullOrEmpty(actionData.GetAsString("CalculatePrice"))) { order.CalculatePrice = actionData.GetAsBoolean("CalculatePrice"); } if (order != null) { order.Tag = tag; } actionData.DataObject.Order = order; order.PublishEvent(EventTopicNames.OrderAdded); } }
public override void Process(ActionData actionData) { var entityId = actionData.GetDataValueAsInt("EntityId"); var entityTypeId = actionData.GetDataValueAsInt("EntityTypeId"); var stateName = actionData.GetAsString("EntityStateName"); var state = actionData.GetAsString("EntityState"); var quantityExp = actionData.GetAsString("QuantityExp"); var entityName = actionData.GetAsString("EntityName"); if (state != null) { if (!string.IsNullOrWhiteSpace(entityName)) { if (entityTypeId == 0) { var entityTypeName = actionData.GetAsString("EntityTypeName"); var entityType = _cacheService.GetEntityTypeByName(entityTypeName); if (entityType != null) { entityTypeId = entityType.Id; } } _entityServiceClient.UpdateEntityState(entityName, entityTypeId, stateName, state, quantityExp); } else if (entityId > 0 && entityTypeId > 0) { _entityServiceClient.UpdateEntityState(entityId, entityTypeId, stateName, state, quantityExp); } else { var ticket = actionData.GetDataValue <Ticket>("Ticket"); if (ticket != null) { var entityTypeName = actionData.GetAsString("EntityTypeName"); foreach (var ticketEntity in ticket.TicketEntities) { var entityType = _cacheService.GetEntityTypeById(ticketEntity.EntityTypeId); if (string.IsNullOrEmpty(entityTypeName.Trim()) || entityType.Name == entityTypeName) { _entityServiceClient.UpdateEntityState(ticketEntity.EntityId, ticketEntity.EntityTypeId, stateName, state, quantityExp); } } } } } }
public async sealed override Task ActionOff(ActionData action, SocketReaction reaction) { var tally = (await action.GetTallyData(reaction.UserId)).Select(x => GetEmote(x)).ToArray(); if (tally.Length == 0) { Console.WriteLine("What th e f uck"); // Pretty sure this is also invalid return; } if (tally.Contains(reaction.Emote)) { await Task.WhenAll( ToggleOff(tally, reaction.Channel, reaction.Message.IsSpecified ? reaction.Message.Value : (IUserMessage)(await reaction.Channel.GetMessageAsync(reaction.MessageId)), reaction.UserId, reaction.Emote), action.RemoveTally(reaction.UserId, reaction.Emote.ToString() ?? throw new ArgumentNullException("Reaction emote has null name and it hurts the soul.")) ); } // Seraphina removed the reaction otherwise so it's all good? }
private void ActionProcess(ActionData aData) { while (aData != null) { ActionData NextData = aData.NextData; if (aData.Type == E_ActionType.AT_Skill) { int SkillId = aData.HurtValue; PlaySkillAction(aData.SrcNode, SkillId, aData); } else { ActionListController.Instance.PlayNodeAction(aData.SrcNode, aData); } aData = NextData; } }
private void RecvData(byte[] receiveData) { disconnected = false; string recvStr = Encoding.UTF8.GetString(receiveData); recvStr = recvStr.TrimEnd('\0'); if (string.IsNullOrEmpty(recvStr)) { return; } textBoxReceive.AppendText($"{recvStr}\r\n"); Dictionary <string, object> dataRecvDic = JsonUtils.Instance.JsonToDictionary(recvStr) as Dictionary <string, object>; if (dataRecvDic != null && dataRecvDic.ContainsKey("action")) { if (dataRecvDic != null && dataRecvDic.ContainsKey("action")) { string action = dataRecvDic["action"].ToString(); IEnumerable <WebSocketProtocolData> protocols = WebSocketManager.Instance.ProtocolDatas.Where(data => { return(data.Protocol == action); }); WebSocketProtocolData protocol = protocols.FirstOrDefault(); if (protocols != null) { // 获取当前程序集 Assembly assembly = Assembly.GetExecutingAssembly(); //dynamic obj = assembly.CreateInstance("类的完全限定名(即包括命名空间)"); dynamic obj = assembly.CreateInstance($"SoftLiu_VSMainMenuTools.SocketClient.WebSocketData.Data.{protocol.Type}"); if (obj is ActionData) { ActionData data = obj as ActionData; data.Init(recvStr); } else { Console.WriteLine($"WebSocketProtocolData CreateInstance is null, action: {action}, type: {protocol.Type}"); } } else { Console.WriteLine($"WebSocketProtocolData is null, action: {action}"); } } } }
private void DoRemainingAction(INode aNode) { if (ActionList.ContainsKey(aNode)) { ActionData aData = ActionList[aNode]; ActionProcess(aData); ActionList.Remove(aNode); } /*map<INode*, ActionData*>::iterator itor = ActionList.find(aNode); * if (itor == ActionList.end()) return; * ActionData* aData = itor->second; * if (_CurItor == itor) * _CurItor++; * ActionList.erase(itor); * ActionProcess(aNode, aData);*/ }
public override void Process(ActionData actionData) { var ticket = actionData.GetDataValue <Ticket>("Ticket"); if (ticket != null) { var calculationTypeName = actionData.GetAsString("CalculationType"); var calculationType = _cacheService.GetCalculationTypeByName(calculationTypeName); if (calculationType != null) { var amount = actionData.GetAsDecimal("Amount"); ticket.AddCalculation(calculationType, amount); _ticketService.RecalculateTicket(ticket); EventServiceFactory.EventService.PublishEvent(EventTopicNames.RegenerateSelectedTicket); } } }
public async sealed override Task ActionOn(ActionData action, SocketReaction reaction) { var tally = (await action.GetTallyData(reaction.UserId)).Select(x => GetEmote(x)).ToArray(); if (!await ToggleOn(tally, reaction)) { if (!((reaction.Message.IsSpecified ? reaction.Message.Value : await reaction.Channel.GetMessageAsync(reaction.MessageId)) is IUserMessage message)) { Console.WriteLine("Can't do toggle actions on non-user messages"); return; } await message.RemoveReactionAsync(reaction.Emote, reaction.User.IsSpecified?reaction.User.Value : await reaction.Channel.GetUserAsync(reaction.UserId)); return; } await action.AddTally(reaction.UserId, reaction.Emote.ToString() ?? throw new ArgumentNullException("Reaction emote has null name somehow. Asshole emote.")); }
protected override void QueueActions() { Assert.AreEqual("Action", this.ParameterSetName, "The resolved parameter set name is incorrect."); foreach (string token in this.Action) { var data = new ActionData() { CommandLine = null != this.Properties && 0 < this.Properties.Length ? string.Join(" ", this.Properties) : null, Action = token, Weight = 100, }; this.QueueCount++; this.Actions.Enqueue(data); } }
public override void Process(ActionData actionData) { var ticket = actionData.GetDataValue <Ticket>("Ticket"); var pjName = actionData.GetAsString("PrintJobName"); if (!string.IsNullOrEmpty(pjName)) { var j = _cacheService.GetPrintJobByName(pjName); if (j != null) { var copies = actionData.GetAsInteger("Copies"); var printTicket = actionData.GetAsBoolean("PrintTicket", true); var priority = actionData.GetAsBoolean("HighPriority"); if (ticket != null && printTicket) { var orderTagName = actionData.GetAsString("OrderTagName"); var orderTagValue = actionData.GetAsString("OrderTagValue"); var orderStateName = actionData.GetAsString("OrderStateName"); var orderState = actionData.GetAsString("OrderState"); var orderStateValue = actionData.GetAsString("OrderStateValue"); Expression <Func <Order, bool> > expression = ex => true; if (!string.IsNullOrWhiteSpace(orderTagName)) { expression = ex => ex.OrderTagExists(y => y.TagName == orderTagName && y.TagValue == orderTagValue); } if (!string.IsNullOrWhiteSpace(orderStateName)) { expression = expression.And(ex => ex.IsInState(orderStateName, orderState)); if (!string.IsNullOrWhiteSpace(orderStateValue)) { expression = expression.And(ex => ex.IsAnyStateValue(orderStateValue)); } } _ticketService.UpdateTicketNumber(ticket, _applicationState.CurrentTicketType.TicketNumerator); ExecuteByCopies(copies, () => _printerService.PrintTicket(ticket, j, expression.Compile(), priority)); } else { ExecuteByCopies(copies, () => _printerService.ExecutePrintJob(j, priority)); } } } }
public static List <SocialInteractionCandidate> Get(Sim actor, Sim target, ShortTermContextTypes category, LongTermRelationshipTypes group, bool isActive, ActiveTopic topic, bool isAutonomous, ref string msg) { Dictionary <LongTermRelationshipTypes, Dictionary <bool, List <string> > > dictionary; List <SocialInteractionCandidate> list = new List <SocialInteractionCandidate>(); if (ActionAvailabilityData.sStcInteractions.TryGetValue(category, out dictionary)) { Dictionary <bool, List <string> > dictionary2; List <string> list2; bool flag = dictionary.TryGetValue(group, out dictionary2); if (!flag) { group = LongTermRelationshipTypes.Default; flag = dictionary.TryGetValue(group, out dictionary2); } if (!flag || !dictionary2.TryGetValue(isActive, out list2)) { msg += Common.NewLine + "Get Fail 1 " + category; return(list); } msg += Common.NewLine + "Get Found " + category + " " + list2.Count; foreach (string str in list2) { ActionData data = ActionData.Get(str); GreyedOutTooltipCallback greyedOutTooltipCallback = null; InteractionTestResult result = data.Test(actor, target, isAutonomous, topic, ref greyedOutTooltipCallback); msg += Common.NewLine + " " + str + " " + result; if ((IUtil.IsPass(result) || (greyedOutTooltipCallback != null)) || Sims3.Gameplay.UI.PieMenu.PieMenuShowFailureReason) { list.Add(new SocialInteractionCandidate(str, data.GetParentMenu(actor, target), topic)); } } } else { msg += Common.NewLine + "Get Fail 2 " + category; } return(list); }
public ActionResult Send(string idsStr, bool proceedIgnoredStatus, string[] ignoredStatus, bool stageOnly, bool localize = false) { int[] ids = null; ignoredStatus = ignoredStatus ?? Enumerable.Empty <string>().ToArray(); ids = idsStr .Split(new[] { ' ', ';', ',', '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .Distinct() .ToArray(); ViewBag.IgnoredStatus = ignoredStatus; ViewBag.Localize = localize; int userId = _userProvider.GetUserId(); string userName = _userProvider.GetUserName(); var parameters = new Dictionary <string, string>(); if (!proceedIgnoredStatus) { parameters.Add("IgnoredStatus", string.Join(",", ignoredStatus)); } if (stageOnly) { parameters.Add("skipPublishing", true.ToString()); parameters.Add("skipLive", true.ToString()); } parameters.Add("Localize", localize.ToString()); string taskData = ActionData.Serialize(new ActionData { ActionContext = new A.ActionContext() { ContentItemIds = ids, ContentId = 288, Parameters = parameters, UserId = userId, UserName = userName } }); var taskKey = typeof(SendProductAction).Name; int taskId = _taskService.AddTask(taskKey, taskData, userId, userName, TaskStrings.PartialSend); return(Json(new { taskId })); }
/// <summary> /// Renders the combat stats and description of an action. /// </summary> /// <param name="action">The action to display.</param> /// <param name="data">The data corresponding to the action to display.</param> /// <returns>A list of string that contains the action description.</returns> private List <string> RenderActionDescription(IDisplayAction action, ActionData data) { int maxLength = 30; int maxHeight = 12; var description = new List <string>(); var reducedStr = action.GetDescription().GetStringAsList(maxLength - 2); for (int i = 0; i < reducedStr.Count(); i++) { string st = ""; st = reducedStr.ElementAt(i); description.Add("║ " + st + new string(' ', maxLength - st.Count() - 2)); } description.Add("║ " + new string(' ', maxLength - 2)); string str = ""; // Display all values that are not 0 or null in the view model foreach (var item in data.GetDisplayableValues()) { if (item.Value != null) { if (item.Value is IEnumerable <string> ) { foreach (var stringVal in item.Value as IEnumerable <string> ) { str = $"Applies {stringVal}"; description.Add("║ " + str + new string(' ', maxLength - str.Count() - 2)); } } else { str = $"{item.Key} : {item.Value}"; description.Add("║ " + str + new string(' ', maxLength - str.Count() - 2)); } } } int currentCount = description.Count(); // Adds empty lines if the description count is less than the max height. for (int i = 0; i < maxHeight - currentCount; i++) { description.Add("║ " + new string(' ', maxLength - 2)); } return(description); }
public void CreateActionEffect(ActionData Data) { foreach (ActionEffectData data in Data.EffectData) { if (data == null) { continue; } if (data.AlliedText != "") { InstantiateActionEffect(AlliedActionEmitter, data.AlliedText); } if (data.EnemyText != "") { InstantiateActionEffect(EnemyActionEmitter, data.EnemyText); } } }
public override void Process(ActionData actionData) { var filePath = actionData.GetAsString("FilePath"); var text = actionData.GetAsString("Text"); try { if (!File.Exists(filePath)) { File.Create(filePath); } File.AppendAllText(filePath, text + Environment.NewLine); } catch (Exception e) { _logService.LogError(e); } }
public ReadFileActionBuilder() { actionItem = ActionData.GetCreateActionItemModel(UI.Types.ActionType.ReadFile); action = new Core.Action.Models.ActionModel(); action.Action = Core.Action.Types.ActionType.ReadFile; inputData = new ReadFileActionInputModel(); inputModels = new List <ActionInputModel>(); actionResultKeys = ActionData.GetActionResults(UI.Types.ActionType.ReadFile); inputModels.Add(new ActionInputModel() { InputType = Types.InputType.Text, Placeholder = "请输入本地文件路径", Title = "文件路径", IsStretch = true, BindingName = nameof(ReadFileActionInputModel.FilePath) }); }
public void SetUp(IActionGUI action) { this.gameObject.SetActive(true); iActionGUI = action; actionData = iActionGUI.ActionData; if (actionData == null) { Logger.LogWarningFormat("UIAction {0}: action data is null!", Category.UIAction, iActionGUI); return; } IconFront.SetCatalogue(actionData.Sprites, 0, NetWork: false); if (actionData.Backgrounds.Count > 0) { IconBackground.SetCatalogue(actionData.Backgrounds, 0, NetWork: false); } }
public OpenURLActionBuilder() { actionItem = ActionData.GetCreateActionItemModel(UI.Types.ActionType.OpenURL); action = new Core.Action.Models.ActionModel(); action.Action = Core.Action.Types.ActionType.OpenURL; inputData = new OpenURLActionInputModel(); inputModels = new List <ActionInputModel>(); actionResultKeys = ActionData.GetActionResults(UI.Types.ActionType.OpenURL); inputModels.Add(new ActionInputModel() { InputType = Types.InputType.Text, Placeholder = "请输入网页链接", Title = "链接", IsStretch = true, BindingName = nameof(OpenURLActionInputModel.URL) }); }
public AActionItem RetainAction(ActionData actionData) { if (m_ActionPoolDic.TryGetValue(actionData.Id, out IActionPool pool)) { return(pool.GetAction()); } else { pool = ActionPool.Creater(actionData.Id); if (pool != null) { m_ActionPoolDic.Add(actionData.Id, pool); return(pool.GetAction()); } } return(null); }
protected override void Perform(BooterHelper.BootFile file, XmlDbRow row) { string name = row.GetString("Name"); if (string.IsNullOrEmpty(name)) { BooterLogger.AddError("Name missing"); return; } if (ActionData.Get(name) == null) { BooterLogger.AddError("ActionData missing: " + name); return; } Add(ParseKey(row), new SeasonSettings.ActionDataSetting(name, row)); }
public void SetActions(List <ActionData> actions) { foreach (Transform child in transform) { Destroy(child.gameObject); } for (int i = 0; i < actions.Count; i++) { Vector3 pos = new Vector3(0, (i * _itemHeight) + _offset, 0); ActionListItem item = GameObject.Instantiate <ActionListItem>(_itemPrefab, Vector3.zero, Quaternion.identity, transform); item.transform.localPosition = pos; ActionData act = actions[i]; item.SetData(act.Text, act.Time, act.Fuel, act.Resources); item.Selected += () => ActionSelected?.Invoke(act); } }
public SoundPlayActionBuilder() { actionItem = ActionData.GetCreateActionItemModel(UI.Types.ActionType.SoundPlay); action = new Core.Action.Models.ActionModel(); action.Action = Core.Action.Types.ActionType.SoundPlay; inputData = new SoundPlayActionInputModel(); inputModels = new List <ActionInputModel>(); actionResultKeys = ActionData.GetActionResults(UI.Types.ActionType.SoundPlay); inputModels.Add(new ActionInputModel() { InputType = Types.InputType.Text, Placeholder = "请输入音频文件路径,支持mp3、wav", Title = "音频文件路径", IsStretch = true, BindingName = nameof(SoundPlayActionInputModel.Path) }); }
public override void Process(ActionData actionData) { string asString = actionData.GetAsString("FileToRestore"); if (!string.IsNullOrEmpty(asString)) { try { BackupItem backupItem = new BackupItem(asString); this._backupHelper.RestoreBackup(backupItem.DatabaseType, DatabaseToolsSettings.Settings.DatabaseName, backupItem.FilePath, true); } catch (Exception exception1) { Exception exception = exception1; MessageBox.Show(exception.Message, "Database Backup Module", MessageBoxButton.OK, MessageBoxImage.Hand); } } }
public void Play(I playerID, params Vector3Int[] pos) { var data = new ActionData() { turn = turn++, playerID = playerID, pos = pos }; _Play(ref data); recentActions.AddLast(data); if (recentActions.Count > MAX_STEP) { if (recentActions.First.Value.turn == undoneActions.Last?.Value.turn) { undoneActions.RemoveLast(); } recentActions.RemoveFirst(); } }
public override void Process(ActionData actionData) { var ticketTypeName = actionData.GetAsString("TicketTypeName"); var ticketType = _cacheService.GetTicketTypes().SingleOrDefault(y => y.Name == ticketTypeName); if (ticketType != null) { _applicationState.TempTicketType = ticketType; } else if (_applicationState.SelectedEntityScreen != null && _applicationState.SelectedEntityScreen.TicketTypeId != 0) { _applicationState.TempTicketType = _cacheService.GetTicketTypeById(_applicationState.SelectedEntityScreen.TicketTypeId); } else { _applicationState.TempTicketType = _cacheService.GetTicketTypeById(_applicationState.CurrentDepartment.TicketTypeId); } }
public SnippingActionBuilder() { actionItem = ActionData.GetCreateActionItemModel(UI.Types.ActionType.Snipping); action = new Core.Action.Models.ActionModel(); action.Action = Core.Action.Types.ActionType.Snipping; inputData = new SnippingActionInputModel(); inputModels = new List <ActionInputModel>(); actionResultKeys = ActionData.GetActionResults(UI.Types.ActionType.Snipping); inputModels.Add(new ActionInputModel() { InputType = Types.InputType.Text, Placeholder = "请输入保存路径", Title = "截图保存路径", IsStretch = true, BindingName = nameof(SnippingActionInputModel.SavePath) }); }