Beispiel #1
0
        private void MousePressed(MouseButtonEventArgs e)
        {
            Zone = _zoneService.InitializeZone(_connexion, _informationService.GetCurrentGameMode().Id);
            OnPropertyChanged(nameof(Zone));
            Point  pos    = e.GetPosition(null);
            double height = ((MainViewGame)e.Source).Height;
            double width  = ((MainViewGame)e.Source).Width;

            height -= height * Scale;
            width  -= width * Scale;
            height /= 2;
            width  /= 2;
            _connexion.Switch((int)((pos.X - width - CenterX * Scale) / (10 * Scale)), (int)((pos.Y - height - CenterY * Scale) / (10 * Scale)), _informationService.GetCurrentPlayer().Id, _informationService.GetCurrentGameMode().Id);
        }