Skip to content
Timorem edited this page Aug 12, 2012 · 8 revisions

There are some simples rules to respect if you want to write a few code and pull request for this project.

Comments

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.

Naming conventions

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)

Events

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.

Message Handlers

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 !

Clone this wiki locally