public Position Move(IMoveCommand moveCommand) { var position = _positions.Last().Move(moveCommand); _positions.Add(position); return(position); }
override public void Select(Tile tile) { if (_playerPiece != null && _currentMoveComand != null) { var tiles = _currentMoveComand.Tiles(_board, _playerPiece); _board.UnHightlight(tiles); if (tiles.Contains(tile)) { _currentMoveComand.Execute(_board, _playerPiece, tile); GameLoop.Instance.Board.Deck.Take((_currentMoveComand).GetCard()); _movesLeft--; } _currentMoveComand = null; _moveManager.ActivateFor(_playerPiece); if (_movesLeft == 0) { StateMachine.MoveTo(GameStates.EnemyPhase1); } } }
private void CombineMove(KimbokoCombine combien, MoveAbilityEventInfo movInfo) { IMoveCommand moveCommand = new IMoveCommand(movInfo, game); Invoker.AddNewCommand(moveCommand); Invoker.ExecuteCommands(); Vector3 startPosition = movInfo.fromTile.GetRealWorldLocation(); Vector3 endPosition = movInfo.endPosition.GetRealWorldLocation(); GameObject[] goToMove = new GameObject[combien.kimbokos.Count]; for (int i = 0; i < goToMove.Length; i++) { goToMove[i] = combien.kimbokos[i].goAnimContainer.GetGameObject(); } //Motion combineMoveMotion = moveManagerUI.CombineMoveMotion(startPosition, endPosition, goToMove); //InvokerMotion.AddNewMotion(combineMoveMotion); //InvokerMotion.StartExecution(game); Animotion combineMoveMotion = moveManagerUI.CombineMoveAnimotion(startPosition, endPosition, goToMove); InvokerAnimotion.AddNewMotion(combineMoveMotion); InvokerAnimotion.StartExecution(game); }
/// <summary>Triggers a move command from a mouse move script. X/Y should be +-1</summary> public void DoMoveCommand(int X, int Y) { if (m_CurrentMove == null) { m_CurrentMove = new CmdMouseMove(); // will move mouse as default. This shouldn't really happen, but safe to do as a fallback } m_CurrentMove.Move(X * MouseStep, Y * MouseStep); }
public void move() { if (currentCommand != null) { currentCommand.move(); commands[currentCommand.getPlayerId()] = currentCommand; currentCommand = null; } }
public Position Move(IMoveCommand moveCommand) { return(moveCommand.Direction switch { Direction.North => MoveY(moveCommand.Steps), Direction.South => MoveY(moveCommand.Steps * -1), Direction.West => MoveX(moveCommand.Steps * -1), Direction.East => MoveX(moveCommand.Steps) });
public MoveCommand(IMoveCommand command) { this.secondsDelay = command.getSecondsDelay(); this.blockName = command.getBlockName(); this.action = command.getAction(); this.value = command.getValue(); this.processed = false; this.haltError = false; }
/// <summary>Should be called on OK/Cancel commands. Returns true if it is consumed by ending a previous move</summary> public bool DoOKCancel(bool ok) { if (m_CurrentMove != null && !(m_CurrentMove is CmdMouseMove)) { m_CurrentMove.End(ok); m_CurrentMove = null; return(true); } return(false); }
public void undo(string playerId) { IMoveCommand command = commands.ContainsKey(playerId) ? commands[playerId] : null; if (command != null) { command.undo(); command.undo(); commands.Remove(playerId); } }
override public void Select(IMoveCommand <Piece> moveComand) { if (_currentMoveComand != null) { _board.UnHightlight(_currentMoveComand.Tiles(_board, _playerPiece)); } _currentMoveComand = moveComand; if (_currentMoveComand != null) { _board.Highlight(_currentMoveComand.Tiles(_board, _playerPiece)); } }
private void NormalMove(MoveAbilityEventInfo movInfo) { IMoveCommand moveCommand = new IMoveCommand(movInfo, game); Invoker.AddNewCommand(moveCommand); Invoker.ExecuteCommands(); Vector3 endPosition = movInfo.endPosition.GetRealWorldLocation(); //Motion normalMoveMotion = moveManagerUI.MoveMotion(movInfo.moveOccupy.goAnimContainer.GetGameObject(), endPosition); //InvokerMotion.AddNewMotion(normalMoveMotion); //InvokerMotion.StartExecution(game); Animotion normalMoveMotion = moveManagerUI.MoveAnimotion(movInfo.moveOccupy.goAnimContainer.GetGameObject(), endPosition); InvokerAnimotion.AddNewMotion(normalMoveMotion); InvokerAnimotion.StartExecution(game); }
virtual public void Select(IMoveCommand <Piece> moveComand) { }
public void QueueMove(IMoveCommand command) { moveQueue.Enqueue(command); }
public async Task MoveNow(IMoveCommand command) { await SendCommand(command.ToURCommand()); }
public void SetMouseMove(IMoveCommand move) { m_CurrentMove?.End(false); // cancel the old one, if any m_CurrentMove = move; }
public void Select(IMoveCommand <Piece> moveComand) { _stateMachine.CurrentSate.Select(moveComand); }
public void setCommand(IMoveCommand command) { currentCommand = command; }
public override void OnExit() { _moveManager.Deactivate(); _currentMoveComand = null; _moveManager.MoveComandProviderChanged -= OnMoveComandManagerChanged; }