## Syntax
Here are various examples and instructions on the syntax required to avoid having conflicts with Unreal and to create a unified codebase.


## Classes, structs, etc

#### Examples

```c++  
UCLASS()
class ARCHINTERACTION_API AArin_PanoMaster : public AActor
```

```c++  
UCLASS()
class ARCHINTERACTION_API UArin_FileHelper : public UBlueprintFunctionLibrary
```

```c++  
UCLASS(ClassGroup = ("Arin|Action"), meta = (BlueprintSpawnableComponent, IsBlueprintBase = "true"))
class ARCHINTERACTION_API UArin_Action : public UStaticMeshComponent
```

```c++  
USTRUCT(BlueprintType)
struct FArin_HitResultLocal
```

#### Structure

```c++  
UCLASS(ClassGroup = ("<Prefix of Plugin>|<Class Name>|<Subcategory>"))
class <Api> <Prefix of Unreal><Prefix of Plugin>_<Class Name> : public UStaticMeshComponent
```

| Element | Description |
| ------- | ----------- |
| Api | Defined by Unreal when you create a new Plugin or Project |
| Prefix of Unreal | A prefix required by Unreal. See the table below. |
| Prefix of Plugin | The name of the Plugin shortened to 4 letters. Only the first Letter is capitalized |
| Class Name | The name of your class |
| Subcategory | An optional subcategory to order your classes, valiables and functions |  

| Prefix of Unreal | Description |
| ------- | ----------- |
| F | Structs |
| A | Classes which inherit from AActor |
| U | All other classes | 
| E | Enums |
| I | Interfaces |

---

## Properties

#### Examples

```c++  
	/**Dit it hit any Surface, with or without triggering Senders*/
	UPROPERTY(BlueprintReadWrite, Category = "Arin|SurfaceTrace")
		bool HitAnything;
```

#### Structure

```c++  
	/**<Comment>*/
	UPROPERTY(BlueprintReadWrite, Category = "<Prefix of Plugin>|<Class Name>|<Subcategory>")
		bool <Property Name>;
```

| Element | Description |
| ------- | ----------- |
| Comment | Comment which will be visible as tooltip |
| Prefix of Plugin | The name of the Plugin shortened to 4 letters. Only the first Letter is capitalized |
| Class Name | The name of your class |
| Property Name | Name of the property in Pascal case (first letter capitalized) |
| Subcategory | An optional subcategory to order your classes, valiables and functions |  

---

## Functions .h

#### Examples

```c++  
	/**Finds all the files within the given directory, with optional file extension filter.
	pDirectory: The directory to iterate the contents of.
	pFileExtension: If FileExtension is NULL, or an empty string "" then all files are found. Otherwise FileExtension can be of the form .EXT or just EXT and only files with that extension will be returned.*/
	UFUNCTION(BlueprintCallable, Category = "Arin|FileHelper|File")
		static void FindFiles(
			UPARAM(ref) TArray<FString>& rFoundFiles,
			AActor* pExamplePointer,
			const FString cFileExtension,
			int cExampleLowMemoryValue);
```

#### Structure

```c++  
	/**<Comment>*/
	UFUNCTION(BlueprintCallable, Category = "<Prefix of Plugin>|<Class Name>|<Subcategory>")
		static void <Function Name>(
			UPARAM(ref) TArray<FString>& <Attribute Prefix><Attribute Name>,
			AActor* <Attribute Prefix><Attribute Name>,
			const FString <Attribute Prefix><Attribute Name>,
			int <Attribute Prefix><Attribute Name>);
```

| Element | Description |
| ------- | ----------- |
| Comment | Comment which will be visible as tooltip |
| Prefix of Plugin | The name of the Plugin shortened to 4 letters. Only the first Letter is capitalized |
| Class Name | The name of your class |
| Subcategory | An optional subcategory to order your classes, valiables and functions |  
| Function Name | Name of the function in Pascal case (first letter capitalized) |
| Attribute Prefix | A prefix required by our Conventions[^1]. See the table below. |
| Attribute Name | Name of the attribute in Pascal case (first letter capitalized) |  

| Attribute Prefix[^1] | Description |
| ------- | ----------- |
| c | A value directly passed, optionally specifically marked as const |
| p | A value passed by pointer (*) |
| r | A value passed by reference (UPARAM(ref) ... &) |

[^1]: This is required, since Unreal won't allow us to use the same name for a function attribute and a property, even when the capitalization is different. Since using the same name is still quite useful, we use this convention.

---

## Functions .cpp

#### Examples

```c++  
FQuat UArin_CodeLib::RotatorToQuat(
	const FRotator& cValue)
{
    FRotator localExampleVariable = cValue;
	return FQuat(cValue);
}
```

#### Structure

```c++  
FQuat <Prefix of Unreal><Prefix of Plugin>_<Class Name>::<Function Name>(
	const FRotator& <Attribute Prefix><Attribute Name>)
{
    FRotator <Local Variable Name> = cValue;
	return FQuat(cValue);
}
```

| Element | Description |
| ------- | ----------- |
| Comment | Comment which will be visible as tooltip |
| Prefix of Plugin | The name of the Plugin shortened to 4 letters. Only the first Letter is capitalized |
| Class Name | The name of your class |
| Subcategory | An optional subcategory to order your classes, valiables and functions |  
| Function Name | Name of the function in Pascal case (first letter capitalized) |
| Attribute Prefix | A prefix required by our Conventions[^1]. See the table below. |
| Attribute Name | Name of the attribute in Pascal case (first letter capitalized) |  
| Local Variable Name | Name of a locally defined variable in Camel case (first letter uncapitalized) |  

| Attribute Prefix[^1] | Description |
| ------- | ----------- |
| c | A value directly passed, optionally specifically marked as const |
| p | A value passed by pointer (*) |
| r | A value passed by reference (UPARAM(ref) ... &) |

[^1]: This is required, since Unreal won't allow us to use the same name for a function attribute and a property, even when the capitalization is different. Since using the same name is still quite useful, we use this convention.
