protected void ConvertToRiver() { // Check if the tile is allowed to be converted to a river: // Needs to connect to either a source or a river and it shouldn't already be a source or a river if ((SurroundedByType <RiverTile>() || SurroundedByType <SourceTile>()) && GetType() != typeof(SourceTile) && GetType() != typeof(RiverTile)) { // Check if the source can have more rivers if (Grid.Source.AvailableRivers > 0) { // Build and replace a new river tile and register it to the source. RiverTile riverTile = Grid.ReplaceTile(this, Grid.RiverTilePrefab) as RiverTile; Grid.Source.AddRiver(riverTile); // Play audio if (AudioController.Instance) { AudioController.Instance.WaterSound(); } } } }
public void AddRiver(RiverTile river) { rivers.Add(river); }