public SpeechBubble(StepInput input) { string message = RegexUtilities.PullOutTextInsideQuotes(ref input.line); this.entity = input.supplier.GetEntityByAlias(input.chunks[0]); this.Message = message; }
public GreenTextStep(StepInput input) { string s = String.Join(" ", input.chunks.ToArray()); string withoutquotes = RegexUtilities.PullOutTextInsideQuotes(ref s); this.Message = withoutquotes; }
public YieldStep(StepInput input) { this.IDs = input.chunks.Skip(1).ToList(); foreach (var item in this.IDs) { System.Diagnostics.Debug.WriteLine(item); } }
public ChangeVisibilityStep(StepInput input) { this.entity = input.supplier.GetEntityByAlias(input.chunks[0]); if (input.args.ContainsKey("show")) { this.Visible = true; } }
public CameraTarget(StepInput input) { if (input.chunks.Count > 2 && input.chunks[1].Contains("=>")) { this.entity = input.supplier.GetEntityByAlias(input.chunks[2]); this.Instant = input.chunks[1].StartsWith("!"); } if (input.args.ContainsKey("distance")) { this.Distance = float.Parse(input.args["distance"]); } if (input.args.ContainsKey("speed")) { this.Speed = float.Parse(input.args["speed"]); } if (input.args.ContainsKey("low")) { this.Pose = "low"; } if (input.args.ContainsKey("high")) { this.Pose = "high"; } if (input.args.ContainsKey("left")) { this.Pose = "left"; } if (input.args.ContainsKey("right")) { this.Pose = "right"; } this.Follow = !input.args.ContainsKey("nofollow"); }
public TurnToFaceStep(StepInput input) { this.entity = input.supplier.GetEntityByAlias(input.chunks[0]); this.FaceTarget = input.supplier.GetEntityByAlias(input.chunks[2]); }
public static bool IsMatch(StepInput input) { return(input.chunks[0] == "yield"); }
public static bool IsMatch(StepInput input) { return(input.chunks.Count > 2 && input.chunks[1].StartsWith("=>") && input.supplier.IsEntity(input.chunks[0]) && RegexUtilities.GetVector3FromString(input.line) != Vector3.zero); }
public static bool IsMatch(StepInput input) { return(input.supplier.IsEntity(input.chunks[0]) && (input.args.ContainsKey("show") || input.args.ContainsKey("hide"))); }
public MoveAiInDirectionStep(StepInput input) { this.Direction = RegexUtilities.GetVector3FromString(input.line); this.SpeedType = StepUtilities.SpeedTypeFromString(input.chunks[1]); this.entity = input.supplier.GetEntityByAlias(input.chunks[0]); }
public static bool IsMatch(StepInput input) { return(input.chunks.Count == 2 && input.chunks[0] == "load_scene"); }
public LoadSceneStep(StepInput input) { this.SceneName = input.chunks[1]; }
public WaitStep(StepInput input) { this.milliseconds = RegexUtilities.GetDigitsFromString(input.chunks[1]); }
public static bool IsMatch(StepInput input) { return(input.chunks[0] == "cam" && input.args.ContainsKey("ease")); }
public ActivateStep(StepInput input) { this.entity = input.supplier.GetEntityByAlias(input.chunks[1]); }
public static bool IsMatch(StepInput input) { return(input.chunks.Count == 3 && (input.chunks[1] == "turn")); }
public static bool IsMatch(StepInput input) { bool match = input.chunks[0] == "cam"; return(match); }
public BaseStep BuildStep(string inputLine) { inputLine = inputLine.Trim(); var split = inputLine.Split(' ').ToList(); var args = split.Where(x => x.StartsWith("--")); var chunks = split .Except(args) .Where(chunk => chunk != "!!"); var argsDict = args.ToDictionary( s => s.Trim('-').Split('=').ElementAtOrDefault(0) ?? "", s => s.Trim('-').Split('=').ElementAtOrDefault(1) ?? ""); var types = System.Reflection.Assembly .GetExecutingAssembly() .GetTypes() .Where(x => x.BaseType == typeof(BaseStep)); StepInput input = new StepInput() { chunks = chunks.ToList(), supplier = this.entitySupplier, args = argsDict.ToDictionary(x => x.Key, x => x.Value.TrimEnd(',')), line = inputLine }; foreach (var item in argsDict) { System.Diagnostics.Debug.WriteLine(item.Key); System.Diagnostics.Debug.WriteLine(item.Value); } bool containsRef = argsDict.ContainsKey("ref"); //System.Diagnostics.Debug.WriteLine("Contains ref :: " + containsRef.ToString()); //System.Diagnostics.Debug.WriteLine("Ref ID :: " + argsDict["ref"]); foreach (var type in types) { var method = type.GetMethod("IsMatch"); if (method != null) { bool isMatch = (bool)method.Invoke(null, new [] { input as object }); if (isMatch) { var constructor = type.GetConstructor(new[] { typeof(StepInput) }); BaseStep step = (BaseStep)constructor.Invoke(new object[] { input }); step.RefID = argsDict.ContainsKey("ref") ? argsDict["ref"] : ""; step.Wait = !inputLine.EndsWith("!!"); return(step); } } } IEntity entity = this.GetEntityFromInput(inputLine); StepAction action = this.GetActionFromInput(inputLine); switch (action) { case StepAction.Move: BaseMoveStep moveStep = MoveToPositionStep.CreateFromInputString(inputLine, this.entitySupplier); if (moveStep != null) { return(moveStep); } throw new MisformedStepException(inputLine); case StepAction.Pose: return(PoseMasterStep.CreateFromInputString(entity, inputLine)); } throw new MisformedStepException(inputLine); }
public WaypointMove(StepInput input) { this.Increment = GetIncrement(input.chunks[1]); this.Instant = input.chunks[1].StartsWith("!"); this.entity = input.supplier.GetEntityByAlias(input.chunks[0]); }
public static bool IsMatch(StepInput input) { bool actionMatch = input.chunks.Count == 2 && GetIncrement(input.chunks[1]) != 0; return(actionMatch && input.supplier.IsEntity(input.chunks[0])); }
public FadeCameraIn(StepInput input) { this.entity = input.supplier.GetEntityByAlias(input.chunks[2]); this.Follow = !input.args.ContainsKey("nofollow"); }
public static bool IsMatch(StepInput input) { return(input.chunks.Count > 1 && input.chunks[0] == "activate"); }
public static bool IsMatch(StepInput input) { return(input.chunks.Count > 1 && input.supplier.IsEntity(input.chunks[0]) && input.chunks[1] == "say"); }
public TurnVectorStep(StepInput input) { this.entity = input.supplier.GetEntityByAlias(input.chunks[0]); this.dir = CreateFromInputString(input.chunks[2]); }
public FadeScreenStep(StepInput input) { this.Alpha = float.Parse(input.chunks[2]); this.SpeedType = StepUtilities.SpeedTypeFromString(input.chunks[1]); }