/** * Ocupa la celda indicada y le asigna el contenido y tipo indicado **/ public void occupyAndConfigureCell(Cell cell, GameObject content, Piece.EType type, Piece.EColor color, bool positionate = false) { cell.occupied = true; setCellContent(cell, content, true, positionate); //destroy setCellContentType(cell, type); setCellContentColor(cell, color); }
public bool existType(Piece.EType type) { for (int i = 0; i < cells.Count; i++) { if (cells[i].contentType == type) { return(true); } } return(false); }
public void setAllCellsToType(Piece.EType type) { for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { //[TODO] asignarle tipo getCellAt(j, i).setType(); } } }
/* * La funcion solo refresca los valores en las celdas */ public void clearCell() { contentType = Piece.EType.NONE; occupied = false; content = null; if ((type & 0x2) == 0x2 || (type & 0x8) == 0x8 || (type & 0x20) == 0x20) { type = 1; available = true; } }
public Cell[] getCellsOfSameType(Piece.EType cellType) { List <Cell> selection = new List <Cell>(); for (int i = 0; i < cells.Count; i++) { if (cells[i].contentType == cellType) { selection.Add(cells[i]); } } return(selection.ToArray()); }
public void setType(int newCellType = 1) { type = newCellType; if ((type & 0x1) == 0x1) { cellType = EType.NORMAL; contentType = Piece.EType.NONE; occupied = false; available = true; content = null; } if ((type & 0x2) == 0x2) { cellType = EType.COLORED; colorIndex = type >> 6; occupied = true; available = true; content = null; updateContentTypeByColorIndex(colorIndex); } if ((type & 0x4) == 0x4) { cellType = EType.EMPTY; contentType = Piece.EType.NONE; occupied = true; available = false; content = null; sprite_renderer.enabled = false; } if ((type & 0x8) == 0x8) { cellType = EType.OBSTACLE_LETTER; contentType = Piece.EType.LETTER_OBSTACLE; occupied = true; available = false; } if ((type & 0x20) == 0x20) { cellType = EType.TUTORIAL_LETTER; contentType = Piece.EType.LETTER; occupied = true; available = false; } }
public void setCellContentType(Cell cell, Piece.EType type) { cell.contentType = type; }
public void setCellContentType(int x, int y, Piece.EType type) { setCellContentType(getCellAt(x, y), type); }
public void setCellContentType(int cellIndex, Piece.EType type) { setCellContentType(cells[cellIndex], type); }
/** * Ocupa la celda indicada y le asigna el contenido y tipo indicado **/ public void occupyAndConfigureCell(int cellIndex, GameObject content, Piece.EType type, Piece.EColor color, bool positionate = false) { occupyAndConfigureCell(cells[cellIndex], content, type, color, positionate); }