public GoBoardPoint PlayerVsCOM() { GoBoardPoint gp = new GoBoardPoint(m_BoardSize / 2 - 1, m_BoardSize / 2 - 1); if (m_StoneList.Count != 0) { gp = findPoint(); } return(gp); }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); Point pos = e.GetPosition(this); if (!m_GoBoardHitBox.Contains(new Point(pos.X - m_Border, pos.Y - m_Border))) { m_MousePosition = GoBoardPoint.Empty; DrawMouseHoverVisual(); return; } int x = (int)Math.Round((pos.X - m_Border) / (m_GoBoardRect.Width / m_BoardSize)); int y = (int)Math.Round((pos.Y - m_Border) / (m_GoBoardRect.Height / m_BoardSize)); m_MousePosition = new GoBoardPoint(x, y); DrawMouseHoverVisual(); }
private GoBoardPoint findPoint() { GoBoardPoint gp = new GoBoardPoint(); long markMax = 0; for (int i = 0; i <= m_BoardSize; i++) { for (int j = 0; j <= m_BoardSize; j++) { if (!m_StoneList.ContainsKey(new GoBoardPoint(i, j))) { long markAttack = markAttack_Vertical(i, j) + markAttack_Horizontal(i, j) + markAttack_CrossRight(i, j) + markAttack_CrossLeft(i, j); long markĐefend = markDefend_Vertical(i, j) + markDefend_Horizontal(i, j) + markDefend_CrossRight(i, j) + markDefend_CrossLeft(i, j); long Temp = markAttack > markĐefend ? markAttack : markĐefend; if (markMax <= Temp) { markMax = Temp; gp = new GoBoardPoint(i, j); } } } } return(gp); }
public RoutedMovePlayedEventArgs(RoutedEvent routedEvent, object source, GoBoardPoint pos, Stone stoneColor) : base(routedEvent, source) { Position = pos; StoneColor = stoneColor; }
public GoBoardAnnotation(GoBoardAnnotationType type, GoBoardPoint position, string text) { m_Type = type; m_Position = position; m_Text = text; }
public GoBoardAnnotation(GoBoardAnnotationType type, GoBoardPoint position) : this(type, position, "") { }
private GoBoardPoint findPoint() { GoBoardPoint gp = new GoBoardPoint(); long markMax = 0; for (int i = 0; i <= m_BoardSize; i++) { for (int j = 0; j <= m_BoardSize; j++) { if (!m_StoneList.ContainsKey(new GoBoardPoint(i, j))) { long markAttack = markAttack_Vertical(i, j) + markAttack_Horizontal(i, j) + markAttack_CrossRight(i, j) + markAttack_CrossLeft(i, j); long markĐefend = markDefend_Vertical(i, j) + markDefend_Horizontal(i, j) + markDefend_CrossRight(i, j) + markDefend_CrossLeft(i, j); long Temp = markAttack > markĐefend ? markAttack : markĐefend; if (markMax <= Temp) { markMax = Temp; gp = new GoBoardPoint(i, j); } } } } return gp; }
public GoBoardPoint PlayerVsCOM() { GoBoardPoint gp = new GoBoardPoint(m_BoardSize / 2 - 1, m_BoardSize / 2 - 1); if (m_StoneList.Count != 0) { gp = findPoint(); } return gp; }