public static WaveObject MakeFromString(string typeKey) { WaveObject resultObj = new WaveObject(); resultObj.Type = ObjectTypeStrings.GetFromString(typeKey); if (resultObj.Type == ObjectType.StartPoint) { // Wave alg init resultObj.Value = 0; } return(resultObj); }
public static WaveObject[,] ConvertToWaveObjectsArray(string[,] array) { int arrayHeight = array.GetUpperBound(1) + 1; if (arrayHeight > 0 && array.Length > 0) { int arrayWidth = array.Length / arrayHeight; var waveObjects = new WaveObject[arrayWidth, arrayHeight]; for (int y = 0; y < arrayHeight; y++) { for (int x = 0; x < arrayWidth; x++) { waveObjects[x, y] = MakeFromString(array[x, y]); } } return(waveObjects); } else { throw new ArgumentException("Array length = 0"); } }