forked from worldforge/cyphesis
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHACKING
63 lines (46 loc) · 2.53 KB
/
HACKING
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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)