Exemplo n.º 1
0
 public FilteredPropertyString(string fieldName) : base(fieldName)
 {
     AvailableActions.Add(CompareAction.Equal);
     AvailableActions.Add(CompareAction.Contains);
     AvailableActions.Add(CompareAction.StartsWith);
     AvailableActions.Add(CompareAction.EndsWith);
 }
Exemplo n.º 2
0
        //private ICoordinates TargetMapTile { get; set; }

        //public CellAction(AvailableActions theAction, ICoordinates targetCell = null)
        public CellAction(AvailableActions theAction, IOffsetVector targetOffset = null)
        {
            this.Action = theAction;
            this.OffsetToTarget = targetOffset;

            //this.TargetMapTile = targetCell;
        }
Exemplo n.º 3
0
 //problem - we have to be over restrictive:
 //(xor a b c) + know(a) + know(b) = know(c)
 private void AddReasoningActions()
 {
     foreach (CompoundFormula cf in Problem.Hidden)
     {
         AvailableActions.AddRange(CreateReasoningActions(cf));
     }
 }
        internal static AvailableActions GetFilteredAvailableActions(AvailableActions availableActions, Version tsVer, bool useUnifiedSchedulingEngine, PowerShellActionPlatformOption psOption)
        {
            var ret      = availableActions;
            var isV1     = tsVer < TaskServiceVersion.V1_2;
            var isAfter7 = tsVer > TaskServiceVersion.V1_3;
            var isWin7   = tsVer == TaskServiceVersion.V1_3;

            // ComHandler not supported in V1
            if (isV1)
            {
                ret &= ~AvailableActions.ComHandler;
            }
            // Email and Message actions were made available in Vista (v1.2) and deprecated in Windows 8 (v1.4)
            // This library can optionally make them available regardless of version
            // Unified Sch Eng disallows these same actions in Win7 (v1.3)
            if ((isV1 && !psOption.IsFlagSet(PowerShellActionPlatformOption.Version1)) || (!psOption.IsFlagSet(PowerShellActionPlatformOption.Version2) && ((useUnifiedSchedulingEngine && isWin7) || isAfter7)))
            {
                ret &= ~(AvailableActions.SendEmail | AvailableActions.ShowMessage);
            }
            if (ret == 0)
            {
                throw new InvalidOperationException("No actions are available to display given the current settings.");
            }
            return(ret);
        }
Exemplo n.º 5
0
 public Node(IState <TAction> state, TAction action, Node <TAction> parent)
 {
     Parent           = parent;
     State            = state;
     Action           = action;
     AvailableActions = state.GetAvailableActions().GetEnumerator();
     AvailableActions.MoveNext();
 }
Exemplo n.º 6
0
 public FilteredPropertyInt(string fieldName) : base(fieldName)
 {
     AvailableActions.Add(CompareAction.Equal);
     AvailableActions.Add(CompareAction.Less);
     AvailableActions.Add(CompareAction.More);
     AvailableActions.Add(CompareAction.Even);
     AvailableActions.Add(CompareAction.Odd);
 }
        private void UpdateAvailableActions(RecipeInfo recipeInfo)
        {
            AvailableActions = CraftingAction.CraftingActions.Values.Where(xx => xx.Level <= Sim.Level).Select(x => new CraftingActionContainer(Sim, x)).ToArray();

            ListViewAvailableIncreasesProgress.ItemsSource = AvailableActions.Where(x => x.Action.IncreasesProgress);
            ListViewAvailableIncreasesQuality.ItemsSource  = AvailableActions.Where(x => x.Action.IncreasesQuality);
            ListViewAvailableAddsBuff.ItemsSource          = AvailableActions.Where(x => x.Action.AddsBuff);
            ListViewAvailableOther.ItemsSource             = AvailableActions.Where(x => !x.Action.IncreasesProgress && !x.Action.IncreasesQuality && !x.Action.AddsBuff);
        }
Exemplo n.º 8
0
    public void DeleteAction()
    {
        var focused = FocusedAction2;

        if (focused != null)
        {
            SelectedActions.Remove(focused);
            AvailableActions.Add(focused);
        }
    }
Exemplo n.º 9
0
    public void AddAction()
    {
        var focused = FocusedAction1;

        if (focused != null)
        {
            AvailableActions.Remove(focused);
            SelectedActions.Add(focused);
        }
    }
Exemplo n.º 10
0
        /// <summary>
        /// these are configurable actions and can be removed and added
        /// </summary>
        public IOActionsManager()
        {
            Action Delete = () => AvailableActions.Delete();
            Action Select = () => AvailableActions.Select();
            Action Save   = () => AvailableActions.Save();

            AvaibleActionsDictionary = new Dictionary <string, Action>();
            AvaibleActionsDictionary.Add(ConfiguredActions.Delete.ToString(), Delete);
            AvaibleActionsDictionary.Add(ConfiguredActions.Save.ToString(), Save);
            AvaibleActionsDictionary.Add(ConfiguredActions.Select.ToString(), Select);
        }
Exemplo n.º 11
0
        private Node <TAction> ExpandRandom()
        {
            var action = AvailableActions.Current;

            AvailableActions.MoveNext();
            var state = State.Apply(action);
            var child = new Node <TAction>(state, action, this);

            Children.Add(child);
            return(child);
        }
Exemplo n.º 12
0
        public void PreviousAction()
        {
            var index = AvailableActions.IndexOf(SelectedAction);

            if (index == 0)
            {
                SelectedAction = AvailableActions[AvailableActions.Count - 1];
            }
            else
            {
                SelectedAction = AvailableActions[index - 1];
            }
        }
Exemplo n.º 13
0
        public void NextAction()
        {
            var index = AvailableActions.IndexOf(SelectedAction);

            if (index == AvailableActions.Count - 1)
            {
                SelectedAction = AvailableActions[0];
            }
            else
            {
                SelectedAction = AvailableActions[index + 1];
            }
        }
Exemplo n.º 14
0
    public virtual void AddAction(UrbAction Action)
    {
        ValidActionCategories = ValidActionCategories | Action.Category;
        if (AvailableActions == null)
        {
            AvailableActions = new [] { Action };
            return;
        }

        UrbAction[] newActions = new UrbAction[AvailableActions.Length + 1];
        AvailableActions.CopyTo(newActions, 1);
        newActions[0] = Action;
    }
Exemplo n.º 15
0
        public void OnConfirmWantsDrag(PointerEventData data)
        {
            if (!AvailableActions.Contains(Action.DRAG_TO))
            {
                return;
            }

            var dragActions = GetDistinctInteractiveActionsOfType(Action.DRAG_TO);

            if (dragActions.Any())
            {
                data.Use();
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// This function executes the action passed on by the brain
        /// (For gameplay perspective the brain should not be able to control the cell himself ;)
        /// </summary>
        /// <param name="action">The action to apply</param>
        public void Do(CellAction action)
        {
            if (this.GetLife() <= 0)
            {
                this.Die();
                return;
            }

            this.cellPreviousAction = action.GetAction();

            switch (action.GetAction())
            {
                case AvailableActions.MOVELEFT:
                    Move(-1,0);
                    break;
                case AvailableActions.MOVERIGHT:
                    Move(1, 0);
                    break;
                case AvailableActions.MOVEUP:
                    Move(0, -1);
                    break;
                case AvailableActions.MOVEDOWN:
                    Move(0, 1);
                    break;
                case AvailableActions.DROP:
                    DropEarth();
                    break;
                case AvailableActions.LIFT:
                    LiftEarth();
                    break;
                case AvailableActions.SPLIT:
                    Split();
                    break;
                case AvailableActions.DIE:
                    Die();
                    break;
                case AvailableActions.EAT:
                    Eat(action.GetOffsetToTarget());
                    break;
                case AvailableActions.ATTACK:
                    Attack(action.GetOffsetToTarget());
                    break;
                case AvailableActions.NONE:
                    break;
                default:
                    throw new NotImplementedException();
            }
            return;
        }
Exemplo n.º 17
0
        public string GetActionPath(AvailableActions action, int?id = null)
        {
            switch (action)
            {
            case AvailableActions.GetCommentsByPostId:
                return(ActionGetCommentsByPostId(id));

            case AvailableActions.GetPostById:
                return(ActionGetPostById(id));

            case AvailableActions.GetPosts:
                return(ActionGetPosts());

            case AvailableActions.GetUsers:
                return(ActionGetUsers());
            }
            return(null);
        }
 public DesignTimeButtonBindingEditorViewModel() : base(null !, null)
 {
     ButtonPressAction    = AvailableActions.Skip(1).First();
     ConfigurationSummary = ButtonPressAction.ConfigurationSummary;
 }
Exemplo n.º 19
0
 /// <summary>Initializes a new instance of the <see cref="ActionEditDialog" /> class with the provided action.</summary>
 /// <param name="action">The action.</param>
 /// <param name="supportV1Only"><c>true</c> if supports V1 only; otherwise, <c>false</c>.</param>
 /// <param name="allowedActions">The allowed actions.</param>
 public ActionEditDialog(Action action, bool supportV1Only = false, AvailableActions allowedActions = AvailableActions.AllActions) : this()
 {
     isV2             = !supportV1Only;
     AvailableActions = allowedActions;
     Action           = action;
 }
Exemplo n.º 20
0
 public FilteredPropertyDateTime(string filedName) : base(filedName)
 {
     AvailableActions.Add(CompareAction.Adult);
     AvailableActions.Add(CompareAction.Teenager);
 }
 public FilteredPropertyDateTime(string fieldName) : base(fieldName)
 {
     AvailableActions.Add(CompareAction.Holiday);
     AvailableActions.Add(CompareAction.Workday);
 }
 /// <summary>Filtered the supplied available actions based on this <see cref="TaskDefinition"/> and the version of the Task Scheduler.</summary>
 /// <param name="td">The <see cref="TaskDefinition"/> instance.</param>
 /// <param name="availableActions">The available actions.</param>
 /// <param name="taskSchedulerVersion">The Task Scheduler version.</param>
 /// <returns>The filtered set of available actions.</returns>
 public static AvailableActions GetFilteredAvailableActions(this TaskDefinition td, AvailableActions availableActions, Version taskSchedulerVersion) =>
 GetFilteredAvailableActions(availableActions, taskSchedulerVersion, td.Settings.UseUnifiedSchedulingEngine, td.Actions.PowerShellConversion);
Exemplo n.º 23
0
    public void Handle(AppSettingsMessage message)
    {
        if (message.Action == SettingsAction.Saving)
        {
            message.Settings["Shortcuts"] = JObject.FromObject(this);

            if (!message.Settings.TryGetObject(out var settings, "Shortcuts"))
            {
                return;
            }

            settings[nameof(Bindings)] = JArray.FromObject(Bindings.Select(x => BindingSettingsModel.FromBinding(x)));
        }
        else if (message.Action == SettingsAction.Loading)
        {
            if (!message.Settings.TryGetObject(out var settings, "Shortcuts"))
            {
                return;
            }

            if (settings.TryGetValue <bool>(nameof(IsKeyboardKeysGestureEnabled), out var isKeyboardKeysGestureEnabled))
            {
                IsKeyboardKeysGestureEnabled = isKeyboardKeysGestureEnabled;
            }
            if (settings.TryGetValue <bool>(nameof(IsMouseAxisGestureEnabled), out var isMouseAxisGestureEnabled))
            {
                IsMouseAxisGestureEnabled = isMouseAxisGestureEnabled;
            }
            if (settings.TryGetValue <bool>(nameof(IsMouseButtonGestureEnabled), out var isMouseButtonGestureEnabled))
            {
                IsMouseButtonGestureEnabled = isMouseButtonGestureEnabled;
            }
            if (settings.TryGetValue <bool>(nameof(IsGamepadAxisGestureEnabled), out var isHidAxisGestureEnabled))
            {
                IsGamepadAxisGestureEnabled = isHidAxisGestureEnabled;
            }
            if (settings.TryGetValue <bool>(nameof(IsGamepadButtonGestureEnabled), out var isHidButtonGestureEnabled))
            {
                IsGamepadButtonGestureEnabled = isHidButtonGestureEnabled;
            }

            if (settings.TryGetValue <List <BindingSettingsModel> >(nameof(Bindings), out var loadedBindings))
            {
                foreach (var gestureDescriptor in Bindings.Keys.ToList())
                {
                    _manager.UnregisterGesture(gestureDescriptor);
                }

                foreach (var binding in loadedBindings)
                {
                    var gestureDescriptor = binding.Gesture;
                    _manager.RegisterGesture(gestureDescriptor);

                    if (binding.Actions == null)
                    {
                        continue;
                    }

                    foreach (var action in binding.Actions)
                    {
                        var actionDescriptor = AvailableActions.FirstOrDefault(d => string.Equals(d.Name, action.Descriptor, StringComparison.OrdinalIgnoreCase));
                        if (actionDescriptor == null)
                        {
                            Logger.Warn($"Action \"{action.Descriptor}\" not found!");
                        }
                        else
                        {
                            _manager.BindActionWithSettings(gestureDescriptor, actionDescriptor, action.Values);
                        }
                    }
                }
            }
        }
    }
Exemplo n.º 24
0
 public FilteredPropertyString(string fieldName) : base(fieldName)
 {
     AvailableActions.Add(CompareAction.Equal);
     AvailableActions.Add(CompareAction.EqualIgnoreCase);
 }
Exemplo n.º 25
0
        private void ToggleAction(Guid key)
        {
            var action = AvailableActions.First(a => a.Key == key);

            action.PlayerAction = RotatePlayerAction(action.PlayerAction);
        }
 /// <summary>Filtered the supplied available actions based on this version of the Task Scheduler and options that could be set on the <see cref="TaskDefinition"/>.</summary>
 /// <param name="ts">The <see cref="TaskService"/> instance.</param>
 /// <param name="availableActions">The available actions.</param>
 /// <param name="useUnifiedSchedulingEngine">if set to <c>true</c> assume the task will use the Unified Scheduling Engine.</param>
 /// <param name="psOption">The PowerShell conversion options to assume are in place.</param>
 /// <returns>The filtered set of available actions.</returns>
 public static AvailableActions GetFilteredAvailableActions(this TaskService ts, AvailableActions availableActions, bool useUnifiedSchedulingEngine = false, PowerShellActionPlatformOption psOption = PowerShellActionPlatformOption.All) =>
 GetFilteredAvailableActions(availableActions, ts.HighestSupportedVersion, useUnifiedSchedulingEngine, psOption);