static UnityVersion ParseUnityVersion(string unityVersion) { Queue <char> chars = new Queue <char>(); for (int i = 0; i < unityVersion.Length; i++) { chars.Enqueue(unityVersion[i]); } UnityVersion version = new UnityVersion(); UnityVersionParser versionParser = new UnityVersionParser(version); while (chars.Count > 0) { char current = chars.Dequeue(); versionParser.HandleState(current); } return(version); }
public UnityVersionParser(UnityVersion versionObject) { this.versionObject = versionObject; this.currentState = VersionState.SettingMajor; this.currentPointer = MajorState; }