The Grendel Project - Win32 MUD Server            (c) 2000,2001 by Michiel Rook



= Coding guidelines & tips ===================================================


This document is not only meant for the people working on the official Grendel
source, but the users who are planning to develop their own code to fit with
the server will also benefit from this - not only will your code be easier 
to read, you will also know what parts of the Grendel core are useful,
and your code will be able to fit in with the official source,
should you wish to post a patch to us!

Please note that this document is by no means complete, and therefor subject
to (regular) change. Feel free to comment on this by mail.


1. Useful parts of the Grendel core

- Socket.pas: powerful Socket classes for both IPv4 & IPv6 communication
- Winsock2.pas: low-level communication routines
- LibXmlParser.pas: XML parser
- Constants.pas: numerous misc. and server-specific constants
- Fsys.pas: Powerful buffered file reader/writer
- Dtypes.pas: Numerous abstract data types, like hash tables, lists, etc.
- Debug.pas: Win32 exception & symbol translation (done automatically if you
  save a .map file with your build)
- Timers.pas: Threaded timers
- Strip.pas: Various string handling routines
- Util.pas: Misc. useful utility routines
- Systray.pas: (only on Win32 platforms) Hooks into the system tray icon
  and allows for dynamic registration of menu handlers
- Console.pas: Provides hooks for console logging of the server. 

The other units are quite specific to the server functionality itself.


2. General coding guidelines

- The naming conventions we use are primarily based on the Java-style:
  classnames start with a capital letter (A-Z), method names (and preferably,
  variable names as well) start with a non-capital letter (a-z).

- When calling empty procedures (that is, procedures without parameters),
  one should use the C-style notation of using empty brackets "Gharacter.IS_NPC()",
  to clarify that this is a procedure, not a variable.


3. Design hints

- Try to code as generic as possible, so that others might be able to use 
  your work.
  
- Use OOP wisely. Place much used code in classes to avoid redundancy,
  and design your classes flexible.

- Use the OOP extensions Delphi is giving you, most notably (published) properties.

