-
Notifications
You must be signed in to change notification settings - Fork 0
Code Conventions
There are some simples rules to respect if you want to write a few code and pull request for this project.
First of all comments are very importants, it's not necessary to write a comment block for each line but just a little help when you write code that is not easy to understand.
Then please respect this naming conventions :
- class in PascalCase (Bot)
- methods in PascalCase (SaySomething())
- properties in PascalCase (Health)
- fields in camelCase with m_ preffix (m_health)
- static readonly & const fields in PascalCase
More here : http://msdn.microsoft.com/en-us/library/ms229045.aspx (Exceptions for generated codes)
If you want to implant an event please always add an invoker like this
protected virtual void OnKilled(FightActor killer) { var evnt = Killed; if (evnt != null) evnt(this, killer); }
You don't have to create a delegate for each event, use Action instead. Always set the first event argument as the sender.
The message handlers methods must be named as follow : Handle{MessageName}
To respect these rules I recommand you to have the ReSharper plugin for Visual Studio, it helps a lot !