Esempio n. 1
0
        public void MakeRelativePathTest()
        {
            string rootPath = @"game.ServerScriptService";
            string absPath1 = @"game.ServerScriptService.Test.Module";
            string absPath2 = @"game.ServerScriptService.Module";

            Assert.AreEqual("Test.Module", RobloxPathHelper.MakeRelativePath(absPath1, rootPath));
            Assert.AreEqual("Module", RobloxPathHelper.MakeRelativePath(absPath2, rootPath));
        }
Esempio n. 2
0
        public static Script FromRoblox(string rbxPath, ScriptType rbxType, Mapping mapping)
        {
            string relativeRbxPath = RobloxPathHelper.MakeRelativePath(rbxPath, mapping.RobloxPath);
            string relativeFsPath  = RobloxPathHelper.ToFsPath(relativeRbxPath);
            string absoluteFsPath  = PathExtension.MakeAbsolutePath(relativeFsPath, mapping.FsPath);
            string ext             = GetExtension(rbxType) + ".lua";

            absoluteFsPath = absoluteFsPath + ext;

            Script script = new Script();

            script.RobloxPath = rbxPath;
            script.FilePath   = absoluteFsPath;
            script.Name       = RobloxPathHelper.GetName(rbxPath);
            script.Type       = rbxType;

            return(script);
        }