Beispiel #1
0
        private void OnChessPieceMovement(object sender, MovementArgs args)
        {
            var service = _gameServiceProvider.ChessClient.Service;
            var from    = args.From;
            var to      = args.To;

            service.Move(_endpointInfo.SessionId, from.FromBusiness(), to.FromBusiness());
        }
Beispiel #2
0
    private void onTouchEnded(object sender, TouchEventArgs args)
    {
        var touch      = args.Touch;
        var gridVector = this.Map.GlobalToGrid(touch.position);

        if (this.pathfinding.VisitablePoints.Contains(gridVector))
        {
            this.ParentController.ClearOverlay();
            Futile.instance.SignalUpdate -= Update;

            var margs = new MovementArgs()
            {
                Actor                  = this.SelectedActor,
                Destination            = gridVector,
                Map                    = this.Map,
                PrecomputedPathfinding = this.pathfinding
            };

            this.MoveAbility.AbilityEnded += abilityEnded;
            this.MoveAbility.StartExecute(margs);
        }
    }
Beispiel #3
0
    private void onTouchEnded(object sender, TouchEventArgs args)
    {
        var touch = args.Touch;
        var gridVector = this.Map.GlobalToGrid(touch.position);
        if (this.pathfinding.VisitablePoints.Contains(gridVector))
        {
            this.ParentController.ClearOverlay();
            Futile.instance.SignalUpdate -= Update;

            var margs = new MovementArgs()
            {
                Actor = this.SelectedActor,
                Destination = gridVector,
                Map = this.Map,
                PrecomputedPathfinding = this.pathfinding
            };

            this.MoveAbility.AbilityEnded += abilityEnded;
            this.MoveAbility.StartExecute(margs);
        }
    }
Beispiel #4
0
 private void ChessBoard_OnPieceMoved(object sender, MovementArgs e)
 {
     tiles[e.OldPosition].Piece         = null;
     tiles[e.PieceMoved.Position].Piece = e.PieceMoved;
 }