Exemplo n.º 1
0
        public static void CreateDash(ref DashPoint point1, ref DashPoint point2)
        {
            Dash      dash     = new Dash(ref point1, ref point2);
            DashPoint minPoint = DashPoint.MinPoint(ref point1, ref point2);

            GetDashesByType(dash.Type)[minPoint.IIndex, minPoint.JIndex] = dash;
            Line line = new Line()
            {
                X1                 = point1.Center.X, Y1 = point1.Center.Y,
                X2                 = point2.Center.X, Y2 = point2.Center.Y,
                Stroke             = new SolidColorBrush(GetCurrentPlayerColor()),
                StrokeThickness    = GetLinesWidth() * Consts.DashWidthRatio / 2,
                StrokeStartLineCap = PenLineCap.Round,
                StrokeEndLineCap   = PenLineCap.Round
            };

            fieldGrid.Children.Add(line);
            if (!HandleClosesCells())
            {
                SwapPlayers();
            }
        }
Exemplo n.º 2
0
 public bool HasCommonPoint(Dash dash)
 {
     return(StartPoint.IsIndexesEquals(dash.StartPoint) || EndPoint.IsIndexesEquals(dash.EndPoint) ||
            StartPoint.IsIndexesEquals(dash.EndPoint) || EndPoint.IsIndexesEquals(dash.StartPoint));
 }
Exemplo n.º 3
0
 public bool IsEqualsLocation(Dash dash)
 {
     return((dash.StartPoint.IsIndexesEquals(StartPoint) && dash.EndPoint.IsIndexesEquals(EndPoint)) ||
            (dash.StartPoint.IsIndexesEquals(EndPoint) && dash.EndPoint.IsIndexesEquals(StartPoint)));
 }