Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Added an explanatory comment to the top of decls.dm. #287

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion code/datums/repositories/decls.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
/var/repository/decls/decls_repository = new()
// /decl is a subtype used for singletons that should never have more than one instance
// in existence at a time. If you want to use a /decl you should use a pattern like:
// var/decl/somedecl/mydecl = decls_repository.get_decl(/decl/somedecl)

// /decls are created the first time they are fetched from decls_repository and will
// automatically call Initialize() and such when created in this way.

// decls_repository.get_decls_of_type() and decls_repository.get_decls_of_subtype()
// can be used similarly to typesof() and subtypesof(), returning assoc instance lists.

// The /decl commandments:
// I. Thou shalt not create a /decl with new().
// II. Thou shalt not del() or qdel() a /decl.
// III. Thou shalt not write a decl that relies on arguments supplied to New().
// IV. Thou shalt not call Initialize() on a /decl.

var/repository/decls/decls_repository = new()

/repository/decls
var/list/fetched_decls
Expand Down