/// Set the cell security. public void SetCellSecurity(int row, int column, Cell.SecurityType security) { m_cells[row * m_column + column].security = security; if (m_viewType == ViewType.SecurityView) { SetGridColor(row, column, GetSecurityColor(security)); } }
private void PaintSecurityBrushRect(int size, Grid grid, Cell.SecurityType security) { for (int i = -size; i <= size; ++i) { for (int j = -size; j <= size; ++j) { PaintSecurityPoint(m_mouseRow + i, m_mouseColumn + j, grid, security); } } }
private void PaintSecurityBrushCross(int size, Grid grid, Cell.SecurityType security) { for (int i = -size; i <= size; ++i) { for (int j = -size; j <= size; ++j) { if (Mathf.Abs(i) + Mathf.Abs(j) > size) { continue; } PaintSecurityPoint(m_mouseRow + i, m_mouseColumn + j, grid, security); } } }
private Color32 GetSecurityColor(Cell.SecurityType security) { switch (security) { case Cell.SecurityType.SafeRegion: return(ColorSafe); case Cell.SecurityType.BattleRegion: return(ColorBattle); case Cell.SecurityType.PVPRegion: return(ColorPVP); } return(new Color32(0, 0, 0, 1)); }
private void PaintSecurityPoint(int i, int j, Grid grid, Cell.SecurityType security) { grid.SetCellSecurity(i, j, security); }