/// <summary> /// Sets up the namespace /// </summary> /// <param name="datapack">The datapack to add the namespace to</param> /// <param name="namespaceName">the name of the namespace</param> public void Setup(BaseDatapack datapack, string namespaceName) { if (!IsSetup) { Name = namespaceName; Datapack = datapack; IsSetup = true; datapack.AddNamespace(this); } else { throw new InvalidOperationException("Setup has already been run."); } }
/// <summary> /// Creates a new namespace in a datapack /// </summary> /// <param name="datapack">The datapack to add the namespace to</param> /// <param name="namespaceName">the name of the namespace</param> public PackNamespace(BaseDatapack datapack, string namespaceName) : base(datapack, namespaceName) { Datapack.FileCreator.CreateDirectory(Datapack.GetDataPath() + Name); }
/// <summary> /// Creates a new namespace in a datapack /// </summary> /// <param name="datapack">The datapack to add the namespace to</param> /// <param name="namespaceName">the name of the namespace</param> public BasePackNamespace(BaseDatapack datapack, string namespaceName) : this() { Setup(datapack, namespaceName); }
/// <summary> /// Creates a new namespace in a datapack. Suggested to use <see cref="MockNamespace.GetNamespace(string)"/> instead /// </summary> /// <param name="datapack">The datapack to add the namespace to</param> /// <param name="namespaceName">the name of the namespace</param> public MockNamespace(BaseDatapack datapack, string namespaceName) : base(datapack, namespaceName) { }