Skip to content

Commit 4823fee

Browse files
committed
1.2.0.0
1 parent 710d332 commit 4823fee

2 files changed

Lines changed: 82 additions & 3 deletions

File tree

.github/STYLEGUIDE.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Coding Guidelines
2+
3+
## Definitions
4+
5+
* [CamelCase](http://en.wikipedia.org/wiki/CamelCase) is a casing convention where the first letter is lower-case, words are not separated by any character but have their first letter capitalized. Example: <code>thisIsCamelCased</code>.
6+
* [PascalCase](http://c2.com/cgi/wiki?PascalCase) is a casing convention where the first letter of each word is capitalized, and no separating character is included between words. Example: <code>ThisIsPascalCased</code>.
7+
8+
## C# coding conventions
9+
10+
We should use the [Allman bracing style](http://en.wikipedia.org/wiki/Indent_style#Allman_style) for consistency.
11+
12+
We are using the C# coding conventions described in this document as a guide, not everything in this doc is gospel and is open to debate: [C# Coding Guidelines](http://blogs.msdn.com/brada/articles/361363.aspx) with the following exceptions:
13+
14+
* Each file should not start with a copyright notice. The ones at the root of the source tree will suffice.
15+
* Regions (#region) are not used.
16+
* using statements are on top of a file (outside of namespace {...})
17+
* Use var only if you have an anonymous type or you can clearly tell what the type is from the right hand side of the expression
18+
* Member variables should always be private, public access should be provided by an encapsulated property.
19+
20+
#### Naming
21+
Follow all .NET Framework Design Guidelines for both internal and external members. Highlights of these include:
22+
* Do use camelCasing for member variables, parameters and local variables
23+
* Do use PascalCasing for function, property, event, and class names
24+
* Do prefix interfaces names with “I”
25+
* Do __not__ use Hungarian notation
26+
* Do __not__ use a prefix for member variables (_, m_, s_, etc.). If you want to distinguish between local and member variables you should use “this.”
27+
* Do __not__ prefix enums, classes, or delegates with any letter
28+
29+
Here is some sample code that follows these conventions.
30+
31+
using System;
32+
namespace NuGet
33+
{
34+
public class ClassName
35+
{
36+
private List<SomeType> privateMember;
37+
38+
public List<SomeType> SomeProperty
39+
{
40+
get
41+
{
42+
return privateMember;
43+
}
44+
}
45+
46+
public string SomeAutoProperty { get; set; }
47+
48+
public string SomeMethod(bool someCondition)
49+
{
50+
if (someCondition)
51+
{
52+
DoSomething(someArgument);
53+
}
54+
else
55+
{
56+
return someArray[10];
57+
}
58+
59+
switch (status)
60+
{
61+
case Status.Foo:
62+
return "Foo";
63+
64+
case Status.Bar:
65+
return "Bar";
66+
67+
default:
68+
return "Bar";
69+
}
70+
return String.Empty;
71+
}
72+
73+
private string AnotherMethod(){
74+
return privateMember.Count;
75+
}
76+
}
77+
}

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ updated: 2020 03 21 -->
66
## Download on [SpaceDock][MOD:rel-spacedock] or [Github][MOD:rel-github] or [Curseforge][MOD:rel-curseforge]. Also available on [CKAN][MOD:rel-ckan].
77

88
# Field Training Lab (FTL)
9-
### Adopted by [@zer0Kerbal][LINK:zer0kerbal] with continued support from the community.
9+
### Adopted by [@zer0Kerbal][LINK:zer0kerbal] [email][LINK:email:zer0Kerbal] with continued support from the community.
1010
#### formerly TrainingLaboratory by [@Efour][LINK:efour]
1111
![Mod Version][shield:mod:latest]
1212
![KSP version][shield:ksp] ![KSP-AVC][shield:kspavc] ![License MIT][shield:license] ![][LOGO:mit]
@@ -194,14 +194,16 @@ License: ![License MIT][shield:license] ![][LOGO:mit]
194194

195195
[thread:mm]: http://forum.kerbalspaceprogram.com/index.php?/topic/50533-* "ModuleManager"
196196
[thread:mc]: https://forum.kerbalspaceprogram.com/index.php?/topic/178484-* " "
197-
[thread:kcl]: https://forum.kerbalspaceprogram.com/index.php?/topic/179207-* "Kerbal Change Log"
197+
[thread:kcl]: https://forum.kerbalspaceprogram.com/index.php?/topic/179207-* "Kerbal Changelog"
198198

199199
[thread:tweakscale]: https://forum.kerbalspaceprogram.com/index.php?/topic/179030-*
200200
[thread:crp]: http://forum.kerbalspaceprogram.com/index.php?/topic/83007-*
201201
[thread:kpbs]: http://forum.kerbalspaceprogram.com/index.php?/topic/133606-1 "Kerbal Planetary Base Systems"
202202
[thread:getsupport]: https://forum.kerbalspaceprogram.com/index.php?/topic/83212-*
203203
[thread:wiki:xp]: https://wiki.kerbalspaceprogram.com/wiki/Experience "KSP WIKI: Experience"
204-
[LINK:zer0Kerbal]: https://forum.kerbalspaceprogram.com/index.php?/profile/190933-zer0kerbal/
204+
[LINK:zer0Kerbal]: https://forum.kerbalspaceprogram.com/index.php?/profile/190933-zer0kerbal/ "zer0Kerbal"
205+
[LINK:email:zer0Kerbal]: mailto:zer0Kerbal@hotmail.com "email zer0Kerbal"
206+
205207
[LINK:efour]: https://forum.kerbalspaceprogram.com/index.php?/profile/152350-efour/ "Efour"
206208
[LINK:orig]: https://forum.kerbalspaceprogram.com/index.php?/profile/152350-efour/ "Efour"
207209

0 commit comments

Comments
 (0)