mirror of
https://github.com/worldforge/cyphesis
synced 2026-08-13 12:26:04 -04:00
63 lines
2.5 KiB
Text
63 lines
2.5 KiB
Text
Cyphesis-C++ development is currently being done on a semi-closed basis.
|
|
I do not currently consider that the code is ready for contributions
|
|
as the design has not quite stabilised. Anyone is encourage however to
|
|
contribute scripts to implement new game features. If your game features
|
|
require modification of the C++ core, please contact me on irc, or using
|
|
the email address given in the AUTHORS file.
|
|
|
|
Al Riddoch <alriddoch@zepler.org>, Saturday May 12th, 2001
|
|
|
|
The following guidelines should be observed when coding cyphesis-C++.
|
|
|
|
TEMPLATES
|
|
|
|
Use of templates is not encouraged.
|
|
|
|
REFERENCES
|
|
|
|
References should be used instead of pointers wherever it is possible.
|
|
If necessary the design of the code should reflect this preference. If a
|
|
pointer is to be used which will be initialised to a value, will never
|
|
change and can never be NULL, then that pointer should be a reference.
|
|
|
|
RETURN VALUES
|
|
|
|
Integer return values should be used when returning success or
|
|
failure. The C library convention of using 0 to indicate success, negative
|
|
numbers to indicate errors, and positive values to indicate other
|
|
statuses should be followed.
|
|
|
|
CODE FORMATTING
|
|
|
|
Hard tabs should not be used anywhere to format the code either in python
|
|
or C++. Normal white spaces should be used at all times.
|
|
|
|
In C++ 4 character indenting is used, with opening braces at the end
|
|
of lines, except at the beginning of methods and functions where they
|
|
should be at the beginning of a line containing no other characters.
|
|
|
|
With the exception of function definitions, { should always be at the end
|
|
of a line, and } should always be the first non-whitespace character on a
|
|
line. In the case of if or for statements, the clause should always be
|
|
enclosed by { } and the opening { should be on the same line as the if or for
|
|
statement.
|
|
|
|
DATA FORMATS
|
|
|
|
Data in the form of rules, and persistent stores conforms to the Atlas
|
|
protocol. Atlas uses strings in a variety of scenarios, the most common
|
|
being type names and property names. These names should be single English
|
|
words using British English spelling and should contain only lower case
|
|
alphabetic characters. Multiple words may be combined where they can
|
|
reasonably be considered as a single word together. A suitable example
|
|
would be "online" which has a distinct meaning alone, but is technically
|
|
correctly spelt as "on line".
|
|
|
|
PROFILING
|
|
|
|
2006-07-10
|
|
|
|
Over 30% of CPU time, and the top 3 functions are spent predicting
|
|
collisions. top 3 functions squareDistance(),
|
|
getCollisionTime(point, vector, point, vector, vector, float)
|
|
predictCollision(loc, loc, float, vector)
|