public MoveCameraAction(VariablesHolder holder) { varHolder = holder; cameraTransform = varHolder.cameraTransform; horizontal = varHolder.horizontalInput; vertical = varHolder.verticalInput; }
public string Parse(string input, ref int offset) { if (offset >= input.Length) { return(null); } if ((new ConstantToken("<$")).Parse(input, ref offset) == null) { return(null); } var expression = (new AnythingExceptToken(new ConstantToken("$>")).Parse(input, ref offset)); if ((new ConstantToken("$>")).Parse(input, ref offset) == null) { throw new ParsingException("Can't find '$>' after '<$'"); } var variables = new VariablesHolder(monitor, context); var result = variables.GetStringVariable(expression); var intVar = variables.GetIntegerVariable(expression); if (intVar != null) { result = string.Format("{0}", intVar.Value); } return(result); }
public ModeCameraTransform(VariablesHolder variablesHolder) { this.variablesHolder = variablesHolder; cameraTransform = variablesHolder.cameraTransform; horizontal = variablesHolder.horizontal; vertical = variablesHolder.vertical; }
public string Parse(string input, ref int offset) { if (offset >= input.Length) return null; if ((new ConstantToken("<$")).Parse(input, ref offset) == null) return null; var expression = (new AnythingExceptToken(new ConstantToken("$>")).Parse(input, ref offset)); if ((new ConstantToken("$>")).Parse(input, ref offset) == null) throw new ParsingException("Can't find '$>' after '<$'"); var variables = new VariablesHolder(monitor, context); var result = variables.GetStringVariable(expression); var intVar = variables.GetIntegerVariable(expression); if (intVar != null) result = string.Format("{0}", intVar.Value); return result; }
public override void Init() { VariablesHolder variablesHolder = Resources.Load("GameVariables") as VariablesHolder; State interactions = new State(); interactions.actions.Add(new InputManager(variablesHolder)); interactions.actions.Add(new HandleMouseInteractions()); interactions.actions.Add(new ModeCameraTransform(variablesHolder)); State wait = new State(); State moveOnPath = new State(); moveOnPath.actions.Add(new MoveCharacterOnPath()); currentState = interactions; startingState = interactions; states.Add("interactions", interactions); states.Add("wait", wait); states.Add("moveOnPath", moveOnPath); }
public override void Init() { VariablesHolder gameVars = Resources.Load("GameVariables") as VariablesHolder; State interactionsState = new State(); interactionsState.actions.Add(new InputAction(gameVars)); interactionsState.actions.Add(new HandleMouseAction()); interactionsState.actions.Add(new MoveCameraAction(gameVars)); State waitState = new State(); // Empty State. No StateActions added here so far... State moveOnPathState = new State(); moveOnPathState.actions.Add(new MoveCharacterOnPathAction()); startingState = interactionsState; currentState = interactionsState; allStates.Add("moveOnPath", moveOnPathState); allStates.Add("interactions", interactionsState); allStates.Add("wait", waitState); }
public InputManager(VariablesHolder holder) { variablesHolder = holder; }
public InputAction(VariablesHolder holder) { varHolder = holder; }