public void Execute(ICallStack callStack, IStoryContext context) { bool result = bool.Parse(ArgumentExpression.Calculate(MainExp)); bool optionalResult = true; if (!string.IsNullOrEmpty(OptionalExp)) { optionalResult = bool.Parse(ArgumentExpression.Calculate(OptionalExp)); } bool resultingIf = callStack.ResultingIf; callStack.AddIfStack(result); if (!result && resultingIf && optionalResult) { nextIndex = callStack.CurrentCommandIndex + 1; } else { var currentScenario = context.ScenarioRepository.GetCurrentRunningScenario(); for (int i = callStack.CurrentCommandIndex + 1; i < currentScenario.Commands.Count; i++) { if (typeof(ILogicControlCommand).IsAssignableFrom(currentScenario.Commands[i].GetType())) { nextIndex = i; break; } } } }
public void Execute(ICallStack callStack, IStoryContext context) { string val = exp; val = context.VariableRepository.GetString(exp); context.MessagePresenter.RenderMessage(val); }
public void Execute(ICallStack callStack, IStoryContext context) { Color maskColor = Color.black; ColorUtility.TryParseHtmlString(color, out maskColor); context.ScenePresenter.MaskOn(time, maskColor, wait); }
public void Inject(IStoryContext context) { systemSound = context.SystemSound; audioPlayer = context.AudioPlayer; storyPlayer = context.StoryPlayer; messageLogger = context.MessageLogger; }
public static void Resolve(this IStoryContext context) { Type myType = context.GetType(); PropertyInfo[] propertyInfos = myType.GetProperties(); List <IStoryEventListener> eventListeners = new List <IStoryEventListener>(); foreach (PropertyInfo propertyInfo in propertyInfos) { var propInstance = propertyInfo.GetValue(context); if (propInstance != null) { Type propType = propInstance.GetType(); if (typeof(IStoryContextInjectable).IsAssignableFrom(propType)) { IStoryContextInjectable injectable = (IStoryContextInjectable)propInstance; injectable.Inject(context); } if (typeof(IStoryEventListener).IsAssignableFrom(propType)) { eventListeners.Add((IStoryEventListener)propInstance); } } } if (typeof(IStoryEventDispatcher).IsAssignableFrom(myType)) { var methodInfo = myType.GetMethod("AddEventListener"); methodInfo.Invoke(context, new object[] { eventListeners.ToArray() }); } }
public void Execute(ICallStack callStack, IStoryContext context) { ArgumentExpression eo = new ArgumentExpression(exp); string result = ArgumentExpression.Calculate(eo.exp); context.VariableRepository.SetString(eo.name, result); }
public void Execute(ICallStack callStack, IStoryContext context) { var prevCall = callStack.Pop(); jumpIndex = prevCall.index; //throw new NotImplementedException(); context.ScenarioRepository.JumpToScenario(prevCall.scenarioNname); }
public void Execute(ICallStack callStack, IStoryContext context) { context.VariableRepository.SetString(name, dname); context.ActorPresenter.RegisterNewActor(name, tag, asset); if (!string.IsNullOrEmpty(size)) { context.ActorPresenter.SetSize(name, size); } }
public void Execute(ICallStack callStack, IStoryContext context) { string show_name = val; context.ActorPresenter.SetFocus(val); show_name = ArgumentExpression.replaceVariable(val, context.VariableRepository); //show_name = context.VariableRepository.GetString(val); context.MessagePresenter.SetTokenName(show_name); }
public void Execute(ICallStack callStack, IStoryContext context) { if (callStack.Count > 0) { var stackItem = callStack.Pop(); context.ScenarioRepository.JumpToScenario(stackItem.scenarioNname); index = stackItem.index; } }
public StoryUnitOfWork(IStoryContext context, IStoryRepository stories, ICommentRepository comments, IHashtagRepository hashtags, IGroupRepository groups ) : base(context) { Stories = stories; Comments = comments; Hashtags = hashtags; Groups = groups; }
public void Execute(ICallStack callStack, IStoryContext context) { if (!string.IsNullOrEmpty(face)) { context.ActorPresenter.SetActorFace(name, face); } if (!string.IsNullOrEmpty(size)) { context.ActorPresenter.SetSize(name, size, time); } context.ActorPresenter.SetRegion(name, region); context.ActorPresenter.ShowActor(name, time, wait); }
public void Execute(ICallStack callStack, IStoryContext context) { nextIndex = callStack.Push(); var macro = context.ScenarioMacroRepository.GetMacro(name); if (macro != null) { nextIndex = macro.index; context.ScenarioRepository.JumpToScenario(macro.file_name); } else { nextIndex += 1; } }
public void Execute(ICallStack callStack, IStoryContext context) { bool useExternalSource = string.IsNullOrEmpty(source); if (string.IsNullOrEmpty(name)) { name = useExternalSource ? source : asset; } if (string.IsNullOrEmpty(tag)) { tag = name; } context.ScenePresenter.RegisterImageFromAssetSource(name, tag, asset); }
public void Execute(ICallStack callStack, IStoryContext context) { int currentIndex = callStack.CurrentCommandIndex; Scenario currentScenario = context.ScenarioRepository.GetCurrentRunningScenario(); Macro macro = new Macro(name, currentScenario.name, currentIndex); context.ScenarioMacroRepository.RecordMacro(macro); for (int i = currentIndex; i < currentScenario.Commands.Count; i++) { ICommand command = currentScenario.Commands[i]; if (command is EndmacroCommand) { endIndex = i; } } }
public void Execute(ICallStack callStack, IStoryContext context) { FontOverrideData fontOverrideData = FontOverrideData.Default; if (!string.IsNullOrEmpty(color)) { fontOverrideData.ColorCode = color; } if (size > float.Epsilon) { fontOverrideData.Size = size; } fontOverrideData.Bold = bold; fontOverrideData.Italics = italics; context.MessagePresenter.SetFont(fontOverrideData); }
public void Execute(ICallStack callStack, IStoryContext context) { callStack.ClearIfStack(); if (string.IsNullOrEmpty(file)) { file = context.ScenarioRepository.GetCurrentRunningScenario().name; } file = ArgumentExpression.replaceVariable(file, context.VariableRepository); context.ScenarioRepository.JumpToScenario(file); target = ArgumentExpression.replaceVariable(target, context.VariableRepository); if (index < 0) { index = context.ScenarioRepository.GetScenario(file).getIndex(target); } }
public void Execute(ICallStack callStack, IStoryContext context) { bool useExternalSource = string.IsNullOrEmpty(source); if (string.IsNullOrEmpty(name)) { name = useExternalSource ? source : asset; } if (string.IsNullOrEmpty(tag)) { tag = name; } if (useExternalSource) { context.ScenePresenter.RegisterBackgroundFromAssetSource(name, tag, asset); } else { context.ScenePresenter.RegisterBackgroundFromExternalSource(name, tag, source); } //context.ScenePresenter.ShowBackground(tag); }
public void Execute(ICallStack callStack, IStoryContext context) { context.ActorPresenter.HideActor(name, time, wait); }
public void Execute(ICallStack callStack, IStoryContext context) { context.SelectionPresenter.ShowSelections(); }
public void Execute(ICallStack callStack, IStoryContext context) { }
public void Execute(ICallStack callStack, IStoryContext context) { string tagToUse = string.IsNullOrEmpty(tag) ? name : tag; context.ScenePresenter.ShowImage(tagToUse); }
public void Execute(ICallStack callStack, IStoryContext context) { throw new NotImplementedException(); }
public void Execute(ICallStack callStack, IStoryContext context) { context.MessagePresenter.ShowMessage(0f); }
public void Execute(ICallStack callStack, IStoryContext context) { context.AssetSource.AddTag(source, tag); }
public void Inject(IStoryContext context) { this.context = context; callStack = new CallStack(context); }
public HashtagRepository(IStoryContext storyDbContext) : base(storyDbContext) { }
public void Inject(IStoryContext context) { this.assetSource = context.AssetSource; }
public void Execute(ICallStack callStack, IStoryContext context) { context.ActorPresenter.RegisterActorFace(name, face, asset); }
public void Execute(ICallStack callStack, IStoryContext context) { context.MessagePresenter.Interactable = false; }