Skip to content

Commit 00535d3

Browse files
authored
C# namespacing clarifications (#9)
1 parent c49f555 commit 00535d3

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

docs/Conventions/pull-requests.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ A "namespace" is a subfolder in the game's directories that represents original
2727

2828
All content original to Macrocosm **must be in the `_MACRO`** namespace. This includes all new **prototypes**, **audio**, **textures**, **locale strings**, and **C# code**. When a Microcosm ports their own features to Macrocosm ("upstreaming"), the ported feature should be moved from the Microcosm's namespace (if any) into the `_MACRO` namespace.
2929

30+
:::note[C# Namespaces]
31+
32+
When declaring a namespace in a C# file, there are times when it is more efficient not to use `_MACRO`. If you're writing an extension of an existing `partial` system, you should declare the namespace as the existing system's namespace. Doing this means you don't have to go into all the files that use the existing system and add new `using`s.
33+
34+
For fully original classes / interfaces / etc. you should use `_MACRO` in the namespace declaration.
35+
36+
This only affects the namespace *declaration*. All files should still be in `_MACRO` subfolders.
37+
38+
:::
39+
3040
### Content should be easy for a downstream to disable
3141

3242
Macrocosm prides itself on its customizability as a base for downstreams. All features should have some way to "opt out" if feasible, ideally via cvars or minimal YML edits. **If a PR introducing a new feature does not provide a way to disable that feature, it may be rejected.**

0 commit comments

Comments
 (0)