Exemple #1
0
        public void CalculateThrowResult(string expected, int x, int y)
        {
            var board = new Dartboard();
            var res   = board.GetResult(x, y);

            Assert.AreEqual(expected, res.ToString());
        }
Exemple #2
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            var x      = (e.X - ClientSize.Width / 2f) / Scale;
            var y      = -(e.Y - ClientSize.Height / 2f) / Scale;
            var result = board.GetResult(x, y);

            if (OnSectorClick != null)
            {
                OnSectorClick(result);
            }
        }