private void FillList(Obstacle obstacle) { characterList = NewCharacterList(); var obstacleLength = obstacle.Name.Length; for (var i = 0; i < dataLength; i++) { var index = GetIndex(2, i); if (index >= characterList.Count) { Debug.Log("ERROR"); } if (i > (obstacleLength - 1)) { //Debug.Log("No more obstacles left to place. Inserting floor tile."); characterList[index] = GetLastCharacter(obstacle.Difficulty); continue; } else { var currentCharacter = obstacle.Name[i]; characterList[index] = currentCharacter; } } }
public List <char> RunDataReader(Obstacle obstacle) { if (obstacle.Name == "") { Debug.Log("Obstable string empty"); return(null); } GenerateData(obstacle); return(characterList); }
private void EditList(Obstacle obstacle) { for (var i = 0; i < characterList.Count; i++) { var character = characterList[i]; switch (character) { case 'F': characterList[i + dataLength] = 'G'; break; case 'J': characterList[i + dataLength] = 'D'; break; case 'j': characterList[i + dataLength] = 'G'; break; case 'G': break; } } }
private void GenerateData(Obstacle obstacle) { FillList(obstacle); EditList(obstacle); }