public static GameObject Create(this GameObject o, string name, Vector3 po, ActionContainer ctor, params Type[] components)
        {
            var go = o.Create(name, po, components);

            go.Dissolve(ctor);
            return(go);
        }
示例#2
0
    public ActionContainer Save()
    {
        GraphSaveUtility saveUtility = GraphSaveUtility.GetInstance(graphView);
        ActionContainer  saved       = null;

        if (graphView.IsCachedFile)
        {
            return(saveUtility.SaveGraph(DefaultCacheName));
        }

        if (graphView.IsDirty)
        {
            if (string.IsNullOrEmpty(graphView.LoadedFileName) || string.IsNullOrWhiteSpace(graphView.LoadedFileName))
            {
                return(SaveAs());
            }

            saved = saveUtility.SaveGraph(graphView.LoadedFileName);
            if (saved)
            {
                graphView.LoadedFileName = saved.ContainerName;
                graphView.SetDirty(false);
                graphView.IsCachedFile = false;
            }
        }
        return(saved);
    }
示例#3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public Oracle(DependencyParserConfig manager, org.maltparser.parser.history.GuideUserHistory history) throws org.maltparser.core.exception.MaltChainedException
        public Oracle(IDependencyParserConfig manager, GuideUserHistory history)
        {
            this.manager     = manager;
            this.history     = history;
            actionContainers = history.ActionContainerArray;

            if (actionContainers.Length < 1)
            {
                throw new ParsingException("Problem when initialize the history (sequence of actions). There are no action containers. ");
            }
            int nLabels = 0;

            for (int i = 0; i < actionContainers.Length; i++)
            {
                if (actionContainers[i].TableContainerName.StartsWith("A.", StringComparison.Ordinal))
                {
                    nLabels++;
                }
            }
            int j = 0;

            arcLabelActionContainers = new ActionContainer[nLabels];
            for (int i = 0; i < actionContainers.Length; i++)
            {
                if (actionContainers[i].TableContainerName.Equals("T.TRANS"))
                {
                    transActionContainer = actionContainers[i];
                }
                else if (actionContainers[i].TableContainerName.StartsWith("A.", StringComparison.Ordinal))
                {
                    arcLabelActionContainers[j++] = actionContainers[i];
                }
            }
        }
示例#4
0
 public void AddGenAction(string name)
 {
     if (ActionContainer != null)
     {
         ActionContainer.AddGenAction(name);
     }
 }
示例#5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void initTransitionSystem(org.maltparser.parser.history.GuideUserHistory history) throws org.maltparser.core.exception.MaltChainedException
        public virtual void initTransitionSystem(GuideUserHistory history)
        {
            actionContainers = history.ActionContainerArray;
            if (actionContainers.Length < 1)
            {
                throw new ParsingException("Problem when initialize the history (sequence of actions). There are no action containers. ");
            }
            int nLabels = 0;

            for (int i = 0; i < actionContainers.Length; i++)
            {
                if (actionContainers[i].TableContainerName.StartsWith("A.", StringComparison.Ordinal))
                {
                    nLabels++;
                }
            }
            int j = 0;

            for (int i = 0; i < actionContainers.Length; i++)
            {
                if (actionContainers[i].TableContainerName.Equals("T.TRANS"))
                {
                    transActionContainer = actionContainers[i];
                }
                else if (actionContainers[i].TableContainerName.StartsWith("A.", StringComparison.Ordinal))
                {
                    if (arcLabelActionContainers == null)
                    {
                        arcLabelActionContainers = new ActionContainer[nLabels];
                    }
                    arcLabelActionContainers[j++] = actionContainers[i];
                }
            }
            initWithDefaultTransitions(history);
        }
        public ActionDirectionView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            Text = "Direction";
            StackLayout stack = new StackLayout();

            SetUpMarginsOnParentControl(stack); //i think.
            ListChooserXF list = new ListChooserXF();

            list.ItemHeight = 60;
            list.LoadLists(actionContainer.Direction1 !);
            stack.Children.Add(list);
            var button = GetGamingButton("Choose Direction", nameof(ActionDirectionViewModel.DirectionAsync));

            button.HorizontalOptions = LayoutOptions.Start;
            button.VerticalOptions   = LayoutOptions.Start;
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            stack.Children.Add(otherStack);
            otherStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            otherStack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = ActionHelpers.GetFinalStack(grid, model, actionContainer, keeperContainer);
        }
        public static T AddComponent <T>(this GameObject o, ActionContainer ctor) where T : Component
        {
            bool a = o.activeSelf;

            o.SetActive(false);

            T c = o.AddComponent <T>();

            object[] prms = new object[ctor.args.Length];
            for (int ai = 0; ai < ctor.args.Length; ai++)
            {
                if (ctor.args[ai] != typeof(T))
                {
                    prms[ai] = o.GetComponentOrThis(ctor.args[ai]);
                }
                else
                {
                    prms[ai] = c;
                }
            }

            ctor.DynamicInvoke(prms);

            o.SetActive(a);
            return(c);
        }
 public ActionDataBuilder CreateFor(ActionContainer actionContainer)
 {
     _actionContainer          = actionContainer;
     _action                   = ObjectCloner.Clone(_cacheService.GetActions().Single(x => x.Id == _actionContainer.AppActionId));
     _containerParameterValues = _actionContainer.ParameterValues ?? "";
     return(this);
 }
        public ActionDoAgainView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            Text = "Card List";
            StackLayout stack = new StackLayout();

            SetUpMarginsOnParentControl(stack); //i think.
            ListChooserXF list = new ListChooserXF();

            list.LoadLists(actionContainer.CardList1 !); // i think
            ScrollView thisScroll = new ScrollView();

            thisScroll.Orientation   = ScrollOrientation.Vertical;
            thisScroll.Content       = list;
            thisScroll.HeightRequest = 500; // well see.
            stack.Orientation        = StackOrientation.Horizontal;
            stack.Children.Add(thisScroll);
            StackLayout finalStack = new StackLayout();

            stack.Children.Add(finalStack);
            var button = GetGamingButton("Select Card", nameof(ActionDoAgainViewModel.SelectCardAsync)); // i think

            finalStack.Children.Add(button);
            button = GetGamingButton("View Card", nameof(ActionDoAgainViewModel.ViewCard));
            finalStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            finalStack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = ActionHelpers.GetFinalStack(grid, model, actionContainer, keeperContainer);
        }
示例#10
0
        public static void AddAction(intAction action, string actionName, int defaultIntValue = 0)
        {
            ActionContainer acon = new ActionContainer(ActionContainer.ActionType._int, action, actionName);

            acon.intDefaultValue = defaultIntValue;
            AddActionToList(acon);
        }
示例#11
0
 public EventHandler(ActionContainer targetActionContainer, float delay, CutsceneEvent cEvent, EEventHandlerType handlerType)
 {
     TargetActionContainer = targetActionContainer;
     Delay       = delay;
     CEvent      = cEvent;
     HandlerType = handlerType;
 }
示例#12
0
        public static void AddAction(booleanAction action, string actionName, bool defaultBooleanState = false)
        {
            ActionContainer acon = new ActionContainer(ActionContainer.ActionType._bool, action, actionName);

            acon.boolStartStatus = defaultBooleanState;
            AddActionToList(acon);
        }
示例#13
0
        public static void AddAction(floatAction action, string actionName, float defaultFloatValue = 0f)
        {
            ActionContainer acon = new ActionContainer(ActionContainer.ActionType._float, action, actionName);

            acon.floatDefaultValue = defaultFloatValue;
            AddActionToList(acon);
        }
示例#14
0
    public IEnumerator AddToCombo(ActionContainer aC)
    {
        if (actionCount >= 3)
        {
            yield break;
        }
        actionCount += 1;

        InputManager.dragging = false;
        aC.gameObject.layer   = 0;
        Transform actionTransform = aC.transform;

        Vector3 assignedPosition = slots [actionCount - 1].position;
        Vector3 originPosition   = actionTransform.position;
        float   dist             = Vector3.Distance(originPosition, assignedPosition);

        for (float i = 0; i <= 1f; i += addingSpeed / dist * Time.deltaTime)
        {
            actionTransform.position = Vector3.Lerp(originPosition, assignedPosition, addingCurve.Evaluate(i));
            yield return(null);
        }
        actionTransform.position = assignedPosition;

        //Add attack to the combo
        comboAttacks [actionCount - 1] = aC.attack;

        yield return(null);
    }
示例#15
0
    public void ProcessCleanAction(ActionContainer action)
    {
        var character = action.GetExecutingCharacter();

        CharacterActions.RaiseCharacterDeterminationBy(2, character);
        Moral.RaiseMoral();
    }
        public ActionEverybodyGetsOneView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            var mainStack = new StackLayout();

            mainStack.Orientation = StackOrientation.Horizontal;
            var player = new PlayerUI(actionContainer, false, 50, 800);

            mainStack.Children.Add(player);
            StackLayout finalStack = new StackLayout();

            mainStack.Children.Add(finalStack);
            FluxxHandXF otherHand = new FluxxHandXF();

            otherHand.LoadList(actionContainer.TempHand !, "");
            otherHand.Margin = new Thickness(3, 15, 0, 0);
            finalStack.Children.Add(otherHand);
            var button = GetGamingButton("Give Cards To Selected Player", nameof(ActionEverybodyGetsOneViewModel.GiveCardsAsync)); // i think

            button.HorizontalOptions = LayoutOptions.Start;
            button.VerticalOptions   = LayoutOptions.Start;
            finalStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            finalStack.Children.Add(button);
            Content = ActionHelpers.GetFinalStack(mainStack, model, actionContainer, keeperContainer);
        }
        //public int ItemHeight
        //{
        //    get
        //    {
        //        return _list.ItemHeight;
        //    }
        //    set
        //    {
        //        _list.ItemHeight = value;
        //    }
        //}
        //public int ItemWidth
        //{
        //    get
        //    {
        //        return _list.ItemWidth;
        //    }
        //    set
        //    {
        //        _list.ItemWidth = value;
        //    }
        //}

        public PlayerUI(ActionContainer actionContainer, bool usePlayerButton, int itemHeight = 40, int itemWidth = 300)
        {
            GamePackageViewModelBinder.ManuelElements.Clear();
            Text = "Player List";
            StackPanel thisStack = new StackPanel();
            SKRect     thisRect  = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(thisStack, thisRect); //i think.
            _list.ItemHeight = itemHeight;
            _list.ItemWidth  = itemWidth;
            _list.LoadLists(actionContainer.Player1 !);
            thisStack.Children.Add(_list);
            if (usePlayerButton)
            {
                var button = GetGamingButton("Choose Player", nameof(ActionTakeUseViewModel.ChoosePlayerAsync)); // i think
                GamePackageViewModelBinder.ManuelElements.Add(button);                                           //try this too.
                var bind = GetVisibleBinding(nameof(ActionContainer.ButtonChoosePlayerVisible));
                button.SetBinding(VisibilityProperty, bind);
                thisStack.Children.Add(button);
            }
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(thisStack);
            Content = grid;
        }
        public ActionDoAgainView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            Text = "Card List";
            StackPanel stack    = new StackPanel();
            SKRect     thisRect = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(stack, thisRect); //i think.
            ListChooserWPF list = new ListChooserWPF();

            list.LoadLists(actionContainer.CardList1 !); // i think
            ScrollViewer thisScroll = new ScrollViewer();

            thisScroll.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
            thisScroll.Content = list;
            thisScroll.Height  = 500; // well see.
            stack.Orientation  = Orientation.Horizontal;
            stack.Children.Add(thisScroll);
            StackPanel finalStack = new StackPanel();

            stack.Children.Add(finalStack);
            var button = GetGamingButton("Select Card", nameof(ActionDoAgainViewModel.SelectCardAsync)); // i think

            finalStack.Children.Add(button);
            button = GetGamingButton("View Card", nameof(ActionDoAgainViewModel.ViewCard));
            finalStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            finalStack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = ActionHelpers.GetFinalStack(grid, model, actionContainer, keeperContainer);
        }
 public ActionContainerViewModel(ActionContainer model, RuleViewModel ruleViewModel, IAutomationService automationService, IAutomationDao automationDao)
 {
     Model              = model;
     _ruleViewModel     = ruleViewModel;
     _automationService = automationService;
     _automationDao     = automationDao;
 }
示例#20
0
        public ActionDirectionView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            Text = "Direction";
            StackPanel stack = new StackPanel();
            SKRect     rect  = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(stack, rect); //i think.
            ListChooserWPF list = new ListChooserWPF();

            list.ItemHeight = 60;
            list.LoadLists(actionContainer.Direction1 !);
            stack.Children.Add(list);
            var button = GetGamingButton("Choose Direction", nameof(ActionDirectionViewModel.DirectionAsync));

            button.HorizontalAlignment = HorizontalAlignment.Left;
            button.VerticalAlignment   = VerticalAlignment.Top;
            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            stack.Children.Add(otherStack);
            otherStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            otherStack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = ActionHelpers.GetFinalStack(grid, model, actionContainer, keeperContainer);
        }
示例#21
0
 public ISpecializedSuiteController<TSubject, TResult> CreateSpecializedSuiteController<TSubject, TResult> (
     SuiteProvider provider,
     ActionContainer<TSubject, TResult> actionContainer,
     Action<ITestController> testControllerConfigurator)
 {
   return new SpecializedSuiteController<TSubject, TResult>(provider, actionContainer, testControllerConfigurator, this, _operationSorter);
 }
示例#22
0
        /// <summary>
        /// Sets the value.
        /// </summary>
        /// <param name="entityType">Type of the entity.</param>
        public void SetValue(EntityTypeCache entityType)
        {
            ItemId   = Constants.None.IdValue;
            ItemName = Constants.None.TextHtml;

            if (entityType != null)
            {
                ItemId   = entityType.Id.ToString();
                ItemName = ActionContainer.GetComponentName(entityType.Name);

                var action = ActionContainer.GetComponent(entityType.Name);
                if (action != null)
                {
                    var actionType = action.GetType();
                    var obj        = actionType.GetCustomAttributes(typeof(ActionCategoryAttribute), true).FirstOrDefault();
                    if (obj != null)
                    {
                        var actionCategory = obj as ActionCategoryAttribute;
                        if (actionCategory != null)
                        {
                            var categoryEntry = ActionContainer.Instance.Categories.Where(c => c.Value == actionCategory.CategoryName).FirstOrDefault();
                            InitialItemParentIds = categoryEntry.Key.ToString();
                        }
                    }
                }
            }
        }
        private async Task LoadActionScreenAsync(ActionContainer actionContainer)
        {
            if (ActionScreen != null)
            {
                throw new BasicBlankException("Previous action was not loaded.  Rethink");
            }
            await CloseMainAsync();
            await CloseKeeperScreenAsync();

            //much harder to figure out which screen to load.
            switch (actionContainer.ActionCategory)
            {
            case EnumActionCategory.None:
                break;

            case EnumActionCategory.Rules:
                break;

            case EnumActionCategory.Directions:
                break;

            case EnumActionCategory.DoAgain:
                break;

            case EnumActionCategory.TradeHands:
                break;

            case EnumActionCategory.UseTake:
                break;

            case EnumActionCategory.Everybody1:
                break;

            case EnumActionCategory.DrawUse:
                break;

            case EnumActionCategory.FirstRandom:
                break;

            default:
                break;
            }

            ActionScreen = actionContainer.ActionCategory switch
            {
                EnumActionCategory.Rules => MainContainer.Resolve <ActionDiscardRulesViewModel>(),
                EnumActionCategory.Directions => MainContainer.Resolve <ActionDirectionViewModel>(),
                EnumActionCategory.DoAgain => MainContainer.Resolve <ActionDoAgainViewModel>(),
                EnumActionCategory.DrawUse => MainContainer.Resolve <ActionDrawUseViewModel>(),
                EnumActionCategory.Everybody1 => MainContainer.Resolve <ActionEverybodyGetsOneViewModel>(),
                EnumActionCategory.FirstRandom => MainContainer.Resolve <ActionFirstCardRandomViewModel>(),
                EnumActionCategory.TradeHands => MainContainer.Resolve <ActionTradeHandsViewModel>(),
                EnumActionCategory.UseTake => MainContainer.Resolve <ActionTakeUseViewModel>(),
                _ => throw new BasicBlankException("Cannot figure out action screen.  Rethink")
            };
            await LoadScreenAsync(ActionScreen);

            RefreshEnables();
        }
示例#24
0
 public void Activate(Unit actionSource, ActionContainer actionContainer)
 {
     this.actionSource    = actionSource;
     this.actionContainer = actionContainer;
     actionContainer.ActivePreview(actionSource);
     isActive = true;
     activated?.Invoke();
 }
    static void Main(string[] args)
    {
        ActionContainer execute = new ActionContainer();
        ProgramTest     prog    = new ProgramTest(execute);

        prog.AddMethod();
        execute.Action();
    }
 public ActionFirstCardRandomViewModel(FluxxGameContainer gameContainer,
                                       ActionContainer actionContainer,
                                       KeeperContainer keeperContainer,
                                       FluxxDelegates delegates,
                                       IFluxxEvent fluxxEvent,
                                       BasicActionLogic basicActionLogic) : base(gameContainer, actionContainer, keeperContainer, delegates, fluxxEvent, basicActionLogic)
 {
 }
示例#27
0
 public ActionEverybodyGetsOneViewModel(FluxxGameContainer gameContainer,
                                        ActionContainer actionContainer,
                                        KeeperContainer keeperContainer,
                                        FluxxDelegates delegates,
                                        IFluxxEvent fluxxEvent,
                                        BasicActionLogic basicActionLogic) : base(gameContainer, actionContainer, keeperContainer, delegates, fluxxEvent, basicActionLogic)
 {
 }
示例#28
0
 public void Activate(Unit unit, ActionContainer actionContainer)
 {
     this.unit            = unit;
     this.actionContainer = actionContainer;
     button.interactable  = unit.CanPerformeAction(this.actionContainer.action);
     icon.sprite          = this.actionContainer.action.icon;
     gameObject.SetActive(true);
 }
示例#29
0
    public void ProcessBuildAction_Wall(ActionContainer action)
    {
        myAction = action;

        int amountOfActionsSpend = ProcessingHelper.CalculateAmountOfActions(action.CharacterTokensSpend);

        HandlePotentialDiceRoll(amountOfActionsSpend);
    }
 private void OnLoadedCommand(object obj)
 {
     actionContainer = obj as ActionContainer;
     if (project != null && mainVM.Data != null)
     {
         actionContainer.ImportActions(project.Actions);
     }
 }
示例#31
0
        [Test] public void AddOneOptionalArgument()
        {
            var actionContainer = new ActionContainer();
            Action res = actionContainer.AddArgument(new Argument("-e", "--example"));

            CollectionAssert.AreEquivalent(new[] {"-e", "--example"},
                ((IActionContainer) actionContainer).OptionStringActions.Keys);

            Assert.That(res, Is.InstanceOf<StoreAction>());
            Asserter.AreEqual(
                new StoreAction(new Argument("-e", "--example") {Destination = "example"}, actionContainer)
                ,
                res);
        }
示例#32
0
        [Test] public void AddOneOptionalArgumentWithActionName()
        {
            var actionContainer = new ActionContainer();
            var argument = new Argument("-e", "--example")
            {
                ActionName = "count"
            };
            var argumentCopy = new Argument(argument);
            argumentCopy.Destination = "example";
            Action res =
                actionContainer.AddArgument(argument);

            CollectionAssert.AreEquivalent(new[] {"-e", "--example"}, argument.OptionStrings);

            Assert.That(res, Is.InstanceOf<CountAction>());
            Asserter.AreEqual(
                new CountAction(argumentCopy, actionContainer),
                res);
        }
示例#33
0
 [Test] public void CreateDefault()
 {
     var actionContainer = new ActionContainer();
     CollectionAssert.AreEqual(new[] {"--", "-", "/"}, actionContainer.Prefixes);
 }
示例#34
0
 public StoreAction(Argument argument, ActionContainer container) : base(argument, container)
 {
 }
示例#35
0
	/**
	 * Show secure prompt dialog. User input is masked by asterisk character
	 * caption - dialog title
	 * message - dialog message
	 * prompt - string to put into text field
	 * buttons - list of buttons
	 * cancellable - Sets whether this dialog could be canceled on tap outside the dialog or back button. (ignored for iOS)
	 * 
	 * first string parameter of onClickAction will be set to data entered
	 * second string parameter of onClickAction will be set to text of button clicked
	 */
	public void ShowSecurePromptMessageBox(string caption, string message, string prompt, string[] buttons, bool cancellable, Action<string, string> onClickAction) {
		if (isMobileRuntime == false) {
			return;
		}
		
		if (buttons.Length == 0 || buttons.Length > 3) {
			Debug.Log("Buttons count should be from 1 to 3");
			return;
		}
		
		int id = 0;
#if UNITY_ANDROID
		id = makeJNICall("securePromptMessageBox", caption, message, buttons, new string[] {prompt}, cancellable);
#elif UNITY_IPHONE
		id = securePromptMessageBox(caption, message, prompt, buttons, buttons.Length, "NativeDialogs");
#endif
		ActionContainer container = new ActionContainer();
		container.action2 = onClickAction;
		_actions.Add(id, container);
	}