API ReferenceSandbox.DataModel

ProjectConfigclass

Configuration of a `Sandbox.Project`.

objectProjectConfig
Namespace
Sandbox.DataModel
Assembly
Sandbox.Engine
Declaration
public class Sandbox.DataModel.ProjectConfig

Constructors1

Showing 1 constructors

Methods4

Showing 4 methods

public T GetMetaOrDefault(string keyname, T defaultValue)PUBLIC

Get the package's meta value. If it's missing or the wrong type then use the default value.

ParameterTypeDescription
keynamestring
defaultValueT
Returns:T

public bool SetMeta(string keyname, object outvalue)PUBLIC

Store custom data at given key in the `Sandbox.DataModel.ProjectConfig.Metadata`.

ParameterTypeDescription
keynamestringThe key for the data.
outvalueobjectThe data itself to store.
Returns:boolAlways true.

public string ToJson()PUBLIC

Serialize the entire config to a JSON string.

Returns:string

public bool TryGetMeta(string keyname, T outvalue)PUBLIC

Try to get a value at given key in `Sandbox.DataModel.ProjectConfig.Metadata`.

ParameterTypeDescription
keynamestringThe key to retrieve the value of.
outvalueTThe value, if it was present in the metadata storage.
Returns:boolWhether the value was successfully retrieved.

Properties16

Showing 16 properties

public System.IO.DirectoryInfo Sandbox.DataModel.ProjectConfig.AssetsDirectory { get; set; }PUBLICGETSET

The directory housing this addon (TODO)

Returns:DirectoryInfo

public System.IO.DirectoryInfo Sandbox.DataModel.ProjectConfig.Directory { get; set; }PUBLICGETSET

The directory housing this addon (TODO)

Returns:DirectoryInfo

public System.Collections.Generic.List`1<string> Sandbox.DataModel.ProjectConfig.EditorReferences { get; set; }PUBLICGETSET

A list of packages that this package uses but there is no need to install. For example, a map package might use a model package - but there is no need to download that model package because any usage will organically be included in the manifest. However, when loading this item in the editor, it'd make sense to install these 'cloud' packages.

Returns:List<string>

public string Sandbox.DataModel.ProjectConfig.FullIdent { get; set; }PUBLICGETSET

Returns a combination of Org and Ident - for example "facepunch.sandbox" or "valve.cs".

Returns:string

public string Sandbox.DataModel.ProjectConfig.Ident { get; set; }PUBLICGETSET

The ident of this addon. For example "sandbox", "cs" or "dm98"

Returns:string

public bool Sandbox.DataModel.ProjectConfig.IncludeSourceFiles { get; set; }PUBLICGETSET

If true then we'll include all the source files

Returns:bool

public bool Sandbox.DataModel.ProjectConfig.IsStandaloneOnly { get; set; }PUBLICGETSET

Whether or not this project is standalone-only, and supports disabling the whitelist, compiling with /unsafe, etc.

Returns:bool

public System.Collections.Generic.Dictionary`2<string,object> Sandbox.DataModel.ProjectConfig.Metadata { get; set; }PUBLICGETSET

Custom key-value storage for this project.

Returns:Dictionary<string,object>

public System.Collections.Generic.List`1<string> Sandbox.DataModel.ProjectConfig.Mounts { get; set; }PUBLICGETSET

A list of mounts that are required

Returns:List<string>

public string Sandbox.DataModel.ProjectConfig.Org { get; set; }PUBLICGETSET

The ident of the org that owns this addon. For example "facepunch", "valve".

Returns:string

public System.Collections.Generic.List`1<string> Sandbox.DataModel.ProjectConfig.PackageReferences { get; set; }PUBLICGETSET

A list of packages that this package depends on. These should be installed alongside this package.

Returns:List<string>

public string Sandbox.DataModel.ProjectConfig.Resources { get; set; }PUBLICGETSET

A list of paths in which to look for extra assets to upload with the addon. Note that compiled asset files are automatically included.

Returns:string

public int Sandbox.DataModel.ProjectConfig.Schema { get; set; }PUBLICGETSET

The version of the addon file. Allows us to upgrade internally.

Returns:int

public string Sandbox.DataModel.ProjectConfig.Title { get; set; }PUBLICGETSET

The human readable title, for example "Sandbox", "Counter-Strike"

Returns:string

public string Sandbox.DataModel.ProjectConfig.Type { get; set; }PUBLICGETSET

The type of addon. Current valid values are "game"

Returns:string

On this page

Constructorspublic ProjectConfig()Methodspublic T GetMetaOrDefault(System.String keyname, T defaultValue)public System.Boolean SetMeta(System.String keyname, System.Object outvalue)public System.String ToJson()public System.Boolean TryGetMeta(System.String keyname, T outvalue)Propertiespublic System.IO.DirectoryInfo Sandbox.DataModel.ProjectConfig.AssetsDirectory { get; set; }public System.IO.DirectoryInfo Sandbox.DataModel.ProjectConfig.Directory { get; set; }public System.Collections.Generic.List`1<System.String> Sandbox.DataModel.ProjectConfig.EditorReferences { get; set; }public System.String Sandbox.DataModel.ProjectConfig.FullIdent { get; set; }public System.String Sandbox.DataModel.ProjectConfig.Ident { get; set; }public System.Boolean Sandbox.DataModel.ProjectConfig.IncludeSourceFiles { get; set; }public System.Boolean Sandbox.DataModel.ProjectConfig.IsStandaloneOnly { get; set; }public System.Collections.Generic.Dictionary`2<System.String,System.Object> Sandbox.DataModel.ProjectConfig.Metadata { get; set; }public System.Collections.Generic.List`1<System.String> Sandbox.DataModel.ProjectConfig.Mounts { get; set; }public System.String Sandbox.DataModel.ProjectConfig.Org { get; set; }public System.Collections.Generic.List`1<System.String> Sandbox.DataModel.ProjectConfig.PackageReferences { get; set; }public Sandbox.Package.Type Sandbox.DataModel.ProjectConfig.PackageType { get; set; }public System.String Sandbox.DataModel.ProjectConfig.Resources { get; set; }public System.Int32 Sandbox.DataModel.ProjectConfig.Schema { get; set; }public System.String Sandbox.DataModel.ProjectConfig.Title { get; set; }public System.String Sandbox.DataModel.ProjectConfig.Type { get; set; }Metadata