diff --git a/GlitchyEngine/src/Extension/System/Array.bf b/GlitchyEngine/src/Extension/System/Array.bf index d7ec359..a2dfc0d 100644 --- a/GlitchyEngine/src/Extension/System/Array.bf +++ b/GlitchyEngine/src/Extension/System/Array.bf @@ -2,16 +2,6 @@ namespace System { public extension Array1 { - /// Returns the index of the given element or -1 if it is not in this array. - public int IndexOf(T element) - { - for(int i < mLength) - if(Ptr[i] == element) - return i; - - return -1; - } - /** * Uses Binary Search to find the index of the given Element. * @param element The element whose element will be returned. diff --git a/GlitchyEngine/src/Extension/System/IO/Directory.bf b/GlitchyEngine/src/Extension/System/IO/Directory.bf index 4fbf2ff..2f712ca 100644 --- a/GlitchyEngine/src/Extension/System/IO/Directory.bf +++ b/GlitchyEngine/src/Extension/System/IO/Directory.bf @@ -10,53 +10,4 @@ extension Directory // TODO: This is obviously windows only return PathIsDirectoryEmptyW(fileName.ToScopedNativeWChar!()); } - - public static Result Copy(StringView fromPath, StringView toPath) - { - if (fromPath.Length <= 2) - return .Err(.InvalidParameter); - if ((fromPath[0] != '/') && (fromPath[0] != '\\')) - { - if (fromPath[1] == ':') - { - if (fromPath.Length < 3) - return .Err(.InvalidParameter); - } - } - - if (!Directory.Exists(fromPath)) - return .Err(.NotFound); - - Try!(Directory.CreateDirectory(toPath)); - - for (var directoryEntry in Directory.EnumerateDirectories(fromPath)) - { - let dirFromPath = scope String(); - directoryEntry.GetFilePath(dirFromPath); - - let dirName = scope String(); - directoryEntry.GetFileName(dirName); - - let dirToPath = scope String(); - Path.Combine(dirToPath, toPath, dirName); - - Try!(Copy(dirFromPath, dirToPath)); - } - - for (var fileEntry in Directory.EnumerateFiles(fromPath)) - { - let fileFromPath = scope String(); - fileEntry.GetFilePath(fileFromPath); - - let fileName = scope String(); - fileEntry.GetFileName(fileName); - - let fileToPath = scope String(); - Path.Combine(fileToPath, toPath, fileName); - - Try!(File.Copy(fileFromPath, fileToPath)); - } - - return .Ok; - } } \ No newline at end of file