Stendhal code design: Difference between revisions

From Arianne
Jump to navigation Jump to search
Content deleted Content added
imported>Hendrik Brummermann
layout
imported>Hendrik Brummermann
fixed spelling
Line 6: Line 6:
Stendhal is completely open source. So you can [http://arianne.sourceforge.net/download/stendhal-src.tar.gz download the source code] and have a look. If you plan to modify it and contribute to the project, we suggest that you use the Eclipse IDE and checkout the latest development state from our version control system.
Stendhal is completely open source. So you can [http://arianne.sourceforge.net/download/stendhal-src.tar.gz download the source code] and have a look. If you plan to modify it and contribute to the project, we suggest that you use the Eclipse IDE and checkout the latest development state from our version control system.


There is a good [[Configure a development environment (IDE)|tutorials]] to get you started with Eclipse.
There are good [[Configure a development environment (IDE)|tutorials]] to get you started with Eclipse.


== Finding your way around the Code ==
== Finding your way around the Code ==

Revision as of 18:47, 17 May 2012

Stendhal code design


This page gives a little overview about the Stendhal code.

Development Environment

Stendhal is completely open source. So you can download the source code and have a look. If you plan to modify it and contribute to the project, we suggest that you use the Eclipse IDE and checkout the latest development state from our version control system.

There are good tutorials to get you started with Eclipse.

Finding your way around the Code

The next step is to find your way around the code. The Stendhal code base is roughly devided into the server, client and a little code that is used by both:


Stendhal Javadoc

The browsable javadoc is located at http://stendhalgame.org/jenkins/job/stendhal_HEAD/javadoc.


Coding Standards

We try to follow SUN Java code convention, in order to create code that feels familiar to many developers.

Despite this:

  • We use tab for all indentation. (One tab is equivalent to 4 spaces for display purpose.)
  • We do not stick too closely to line length.
  • We always use blocks in if-statements and loops, even if the block only consists of one single statement:

if (condition) {
    method();
}

Avoid evaluation and assignment in the same line like:

  • ternary operators, for example in:
 String y = x==null ? "NULL": x.toString();
  • post-increment/decrement operators as in:
 if (idx++ == 10) {
   ...
 }