public GridModel() { m_Cells = new CellItem[kCellCount]; for (int i = 0; i < m_Cells.Length; i++) { m_Cells[i] = new CellItem(i); } }
//Visually change state of cell, set texture on Quad object or diactivate when no texture public void SetState(CellItem cellItem) { if (cellItem.state == CellState.xFilled) { m_CellViews[cellItem.index].SetTexture(m_XTexture); } else if (cellItem.state == CellState.oFilled) { m_CellViews[cellItem.index].SetTexture(m_OTexture); } else { m_CellViews[cellItem.index].SetTexture(null); } }
private bool IsPlayerCell(CellItem cellItem) { if (cellItem.state == CellState.xFilled) { if (playerSing == SignType.X) { return(true); } } else if (cellItem.state == CellState.oFilled) { if (playerSing == SignType.O) { return(true); } } return(false); }
public CellItemChangedEventData(CellItem cellItem) { this.cellItem = cellItem; }
private bool IsEmptyCell(CellItem cellItem) { return(cellItem.state == CellState.empty); }
private bool IsEnemyCell(CellItem cellItem) { return((!IsPlayerCell(cellItem)) && (!IsEmptyCell(cellItem))); }