public void Invoke(ObjectController newParent) { switch (ParentCommand) { case ParentCommand.SetThis: ParentCommand = ParentCommand.None; break; } }
private void ValidateParentCommandArguments(CommandResult commandResult) { var nameArgumentResult = commandResult.Children.FirstOrDefault(symbol => symbol.Symbol == NameArgument); if (nameArgumentResult == null) { return; } ParentCommand.ValidateShortNameArgumentIsNotUsed(commandResult); }
public void Invoke(ObjectController newParent) { switch (ParentCommand) { case ParentCommand.SetThis: SetParentCommand command = new SetParentCommand(_selectedObjectController, newParent); ((ICommand)command).Execute(); ParentCommand = ParentCommand.None; break; } }
public override void Execute(params object[] executeArgs) { if (!ParentCommand.GetType().Equals(typeof(UIScriptCommand))) { GameManager.Instance.log.LogMessage("Invalid UI Update Command", LogMessage.LogType.Error); return; } for (int i = 0; i < SubCommands.Count; i++) { SubCommands[i].Execute(executeArgs); } }
private void SetNewParentCommand(ParentCommand value) { _parentCommand = value; switch (ParentCommand) { case ParentCommand.DeleteParent: break; case ParentCommand.SetNew: break; } }
private void SetNewParentCommand(ParentCommand value) { _parentCommand = value; switch (ParentCommand) { case ParentCommand.DeleteParent: SetParentCommand command = new SetParentCommand(_selectedObjectController, null); ((ICommand)command).Execute(); break; case ParentCommand.SetNew: break; } }
public StoryBoardCommandString(StoryBoardCommandString last, string commandStr, int level, out bool failed) { failed = false; if (!IsInvalidCommand(commandStr)) { Level = level; if (last == null) { Parent = null; } else if (last.Parent == null || last.Level == 0) { Parent = last; ParentCommand = last.CurrentCommand; } else if (last.Level < Level) { Parent = last; ParentCommand = last.CurrentCommand; IsFirstSubCommand = true; } else if (last.Level == Level) { Parent = last.Parent; ParentCommand = last.ParentCommand; } else if (last.Level > level) { Parent = last.Parent.Parent; ParentCommand = last.Parent.ParentCommand; } var curTmp = StoryBoardTools.GetEventClassByString(commandStr); if (curTmp != null) { CurrentCommand = curTmp; } else { CurrentCommand = new StoryBoardMainCommand(); } CurrentCommand.Parse(commandStr); if (CurrentCommand is StoryBoardMainCommand mainCommand) { if (mainCommand.Resource is null) { failed = true; } } if (Parent != null) { if (ParentCommand is null) { var tmp = StoryBoardTools.GetEventClassByString(Parent.Command); if (tmp != null) { ParentCommand = tmp; } else { ParentCommand = new StoryBoardMainCommand(); } } ParentCommand.Parse(Parent.Command); if (CurrentCommand is IStoryBoardSubCommand subCmd) { ParentCommand.SubCommands.Add(subCmd); subCmd.ParentCommand = ParentCommand; } } Command = commandStr; } else { failed = true; Command = null; } }