# Installation
 - Open VSC
 - Open Tools/Code Snippet Manager
 - Select the language on the top, for which you want to add snippets
 - Open a file explorer and navigate to the folder you see in the Snippet Manager
 - Copy the contents of the respective programming language to the folder
 - Check that the path follows this pattern: Language/My Code Snippets/SnippetCreator/*
 - Close and open VSC

# Use: StartFiles
 - After creating a new file, delete all of it's content
 - Add the header:
   - Type: [r],[a],[Tab],[Tab] to create a Header for Raumgleiter
     (If you work on ArchInteraction, type this instead: [p],[i],[Tab],[Tab])
   - Type [.] and either select an existing namespace or write a new one
 - Add the class:
   - Click inside the namespace (Where you want to insert the text)
   - Find the pattern you want to use in the list below
   - Start typing [p],[t] (short for pattern), select the pattern and press [Tab],[Tab]
   - Several properties will be selected. Type the desired value and press [Tab] to switch to a different property
   - Confirm with [Enter] when you're done

# Patterns
## Unity

#### pt_Monobehaviour
|Quality|Description|
|---|---|
|Use|Everything that exists multiple times in the level|
|Example|CameraRig, ElevatorButton|
|Passed by|Reference|
|Can contain functions|yes|
|Can be placed in the level|yes|
|Can have multiple instances|yes|
|Globally accessible|no|

#### pt_Singleton
|Quality|Description|
|---|---|
|Use|Everything that exists only once*|
|Example|ProjectSpawner, BundleLoader|
|Passed by|Reference|
|Can contain functions|yes|
|Can be placed in the level|yes|
|Can have multiple instances|yes|
|Globally accessible|yes|

\* = One instance is accessible globally. Multiple instances can be used without changing the code.

#### pt_CodeAsset
|Quality|Description|
|---|---|
|Use|Everything that exists in the project files or needs to be serialized (JSON)|
|Example|ProjectDatabase, MaterialLibrary, ScriptableVariable|
|Passed by|Reference|
|Can contain functions|yes|
|Can be placed in the level|no|
|Can have multiple instances|yes|
|Globally accessible|no|

#### pt_Class
|Quality|Description|
|---|---|
|Use|Small modules usable by other classes|
|Example|Velocity Motor|
|Passed by|Reference|
|Can contain functions|yes|
|Can be placed in the level|no|
|Can have multiple instances|yes|
|Globally accessible|no|

#### pt_Struct
|Quality|Description|
|---|---|
|Use|For smart variable types|
|Example|Vector3, Iterator, Id, IdDictionary|
|Passed by|Copy|
|Can contain functions|yes|
|Can be placed in the level|no|
|Can have multiple instances|yes|
|Globally accessible|no|

#### pt_Interface
|Quality|Description|
|---|---|
|Use|For defining what functions other classes must contain|
|Example|ICharacter|
|Can contain functions|yes|
|Can contain variables|only as properties (get, set)|

#### pt_Inspector
|Quality|Description|
|---|---|
|Use|Custom Inspector (Details panel) in Editor|
|Example|CameraRig_Inspector|
|Can contain functions|yes|
|Can be placed in the level|no|

#### pt_PermanentSingleton
|Quality|Description|
|---|---|
|Use|Everything that exists only once and should not be unloaded by switching the level*|
|Example||
|Passed by|Reference|
|Can contain functions|yes|
|Can be placed in the level|no|
|Can have multiple instances|partially|
|Globally accessible|yes|

\* = You can also use static variable for keeping values.


## Unreal
...missing

# Code Sections
You will notice a big amount of comments divided by lines and labels. Here is an overview what they contain:  

## Variables
|Label|Description|
|---|---|
|Connections|References to other classes|
|Resources|References to binary assets|
|Attributes|Variables which primarily get set at the start and will only change rarely afterwards|
|Stats|Variables which change often|

## Variables | Properties
|Label|Description|
|---|---|
|Getter|Getter and setter functions with one line of code.|
|Delegates|Delegates|

## Functions | Initialization
|Label|Description|
|---|---|
|awake|Awake() is the first function called by Unity when creating the class|
|start|Start() is called by Unity after Awake()|
|setup|SetUp() is a default function used by Raumgleiter. If a class has such a function, it needs to be called before the rest of the class is usable.|
|destroy|OnDestroy() is called by Unity before the class gets destroyed|

## Functions
|Label|Description|
|---|---|
|update|Update() is called by Unity once a frame. Use Time.deltaTime to get the time since the last call.|
|refresh|Refresh functions are used by Raumgleiter to update certain things at valuechanges or events. It follows the pattern: ClearSomething(), BuildSomething()|
|events|Events are functions which are called by delegates, button presses or other types of events.|
|private|Functions which are not accessible to other classes, including children.|
|protected|Functions which are only accessible to the class and its children.|
|internal|Functions which are accessible to all classes inside the namespace.|
|public|Functions which are accessible to all classes by using a reference.|
|public static|Functions which are globally accessible to all classes.|
|getter, setter|Getter and setter functions with multiple lines of code.|
