Пример #1
0
    private void AddResponse(InputResponder responder, Gameplay.Move_Julia move)
    {
        responder.OnStopClick += (_responder, mousePos) =>
        {
            //Apply the move.
            var results = new Gameplay.MovementResults(Board, move);
            Board.AddElement(false, move.Pos, Gameplay.Teams.Friendly);
            Board.Apply(results, Gameplay.Teams.Friendly);

            //Remove this movement option.
            int moveIndex = moveSpriteIndexAtPos[move.Pos];
            SpritePool.Instance.DeallocateSprite(moveSprites[moveIndex]);
            moveSprites.RemoveAt(moveIndex);
            moveOptions.RemoveAt(moveIndex);
            foreach (Vector2i key in moveSpriteIndexAtPos.Keys.ToList())
            {
                if (moveSpriteIndexAtPos[key] > moveIndex)
                {
                    moveSpriteIndexAtPos[key] -= 1;
                }
            }


            Logic.MovesLeftThisTurn -= 1;
        };
    }
Пример #2
0
 public MovementResults(Board board, Move_Julia move)
 {
     HostBlockMinCorner = GetHostBlock(board, move.Pos, null, Teams.Friendly);
     GetCaptures(board, Captures, null, move.Pos, Teams.Friendly, HostBlockMinCorner);
 }