internal void getStyle(int i, out Color tile, out Color fontColour) { TileStyle style = getStyle(i); fontColour = style.SecondaryTextColour ? secondaryTextColour : primaryTextColour; tile = style.Color; }
public void Back() { BoardState state = history.Pop(); if (state == null) { return; } foreach (TileState tile in state.tiles) { if (tile.Points == -1) { tilePositions[new BoardPos(tile.grid.X, tile.grid.Y)].setEmpty(emptyTileColor); } else { TileStyle style = getStyle(tile.Points); tilePositions[new BoardPos(tile.grid.X, tile.grid.Y)].setTile(tile.Points, style.Color, style.SecondaryTextColour ? secondaryTextColour : primaryTextColour, movementSpeed, false); } } if (isEndOfGame()) { SaveSystem.RemoveBoard(boardSize.X, boardSize.Y); SaveSystem.SaveScore(score, boardSize.X, boardSize.Y); if (GameOver != null) { GameOver.gameObject.SetActive(true); } } else { SaveSystem.SaveBoard(BuildSaveState()); if (GameOver != null) { GameOver.gameObject.SetActive(false); } } }
internal void AddUnknownStyle(TileStyle style) { unknownTileStyle = style; }
internal void AddStyle(TileStyle style) { Styles.Add(style); }
/// <summary> /// Sets a specific tile to a either the lowest or second lowest value /// </summary> /// <param name="tile">tile that will be changed</param> /// <param name="forceLow">force the score to be the lowest</param> private void SpawnTile(Tile tile, bool forceLow = false) { TileStyle style = forceLow ? Styles[0] : highScoreSpawn > Random.Range(0, 1) ? Styles[0] : Styles[1]; tile.setTile(style.score, style.Color, style.SecondaryTextColour ? secondaryTextColour : primaryTextColour, movementSpeed, true); }