Last active
February 14, 2017 03:18
-
-
Save mfoda/76c9bf2dcd95546b9a7ffaccc6dd583b to your computer and use it in GitHub Desktop.
Nez Naming Conventions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Nez Naming Conventions | |
| === | |
| > **Note:** | |
| > A Policy file is available for download [here](https://gist.github.com/mohammadfoda/708a356d49febbb8889e5862f07b3403) which can be imported into Visual Studio and Xamarin Studio. Download and rename to "Nez_Naming_Conventions.mdpolicy" before import. | |
| ___ | |
| ### Namespaces: PascalCase | |
| ```csharp | |
| namespace Nez.PhysicsShapes | |
| { | |
| ... | |
| } | |
| ``` | |
| ### Types: PascalCase | |
| ```csharp | |
| class TouchInput | |
| { | |
| ... | |
| } | |
| ``` | |
| ### Interfaces: IPascalCase | |
| ```csharp | |
| interface IUpdatableManager | |
| { | |
| ... | |
| } | |
| ``` | |
| ### Attributes: PascalCase | |
| ```csharp | |
| [AttributeUsage(AttributeTargets.Property)] | |
| class RangeAttribute : InspectableAttribute | |
| { | |
| ... | |
| } | |
| ``` | |
| ### EventArgs: PascalCase | |
| ```csharp | |
| class TouchEventArgs : EventArgs | |
| { | |
| ... | |
| } | |
| ``` | |
| ### Exceptions: PascalCase | |
| ```csharp | |
| class PointOnEdgeException : NotImplementedException | |
| { | |
| ... | |
| } | |
| ``` | |
| ### Methods: camelCase | |
| ```csharp | |
| void onEnabled() | |
| { | |
| ... | |
| } | |
| ``` | |
| ### Static ReadOnly Fields: camelCase | |
| ```csharp | |
| static Color debugText = Color.White; | |
| ``` | |
| ### Fields: _camelCase | |
| ```csharp | |
| private Camera _camera; | |
| ``` | |
| ### ReadOnly Fields: _camelCase | |
| ```csharp | |
| readonly Camera _camera; | |
| ``` | |
| ### Constant Fields: UPPERCASE | |
| ```csharp | |
| const int SCREEN_SPACE_RENDER_LAYER = 999; | |
| ``` | |
| ### Properties: camelCase | |
| ```csharp | |
| public float rotationDegrees { get; set; } | |
| ``` | |
| ### Events: PascalCase | |
| ```csharp | |
| event EventHandler ScreenRotated; | |
| ``` | |
| ### Enum Members: PascalCase | |
| ```csharp | |
| enum InputState | |
| { | |
| PanBegin, | |
| DragBegin, | |
| PinchBegin, | |
| ... | |
| } | |
| ``` | |
| ### Parameters: camelCase | |
| ```csharp | |
| void deleteEntity(Entity entity) | |
| { | |
| ... | |
| } | |
| ``` | |
| ### Type Parameters: TPascalCase | |
| ```csharp | |
| abstract class BaseShape<TCollider> | |
| where TCollider : Collider | |
| { | |
| ... | |
| } | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment