Example #1
0
 /// <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.");
     }
 }
Example #2
0
 /// <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);
 }
Example #3
0
 /// <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);
 }
Example #4
0
 /// <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)
 {
 }