Skip to content

Commit

Permalink
added some docs, added UML diagram for main classes. added second try…
Browse files Browse the repository at this point in the history
… with main engine.
  • Loading branch information
Daniel (dmilith) Dettlaff committed Aug 24, 2008
1 parent b10473e commit c58b410
Show file tree
Hide file tree
Showing 17 changed files with 945 additions and 274 deletions.
1 change: 1 addition & 0 deletions CleanAll
@@ -1,6 +1,7 @@
echo "Cleaning up.."
scons -c
rm -f *.os
rm -f *.o
rm -f *.so
rm -f test_*
cd tests/
Expand Down
9 changes: 5 additions & 4 deletions Sconstruct
@@ -1,13 +1,14 @@
import os
print 'scons script written by dmilith[at]gmail[dot]com (c) 2oo8'

release32 = Environment( CXX = 'g++ -m32 -O2 -march=athlon64' )
release32 = Environment( CXX = 'g++ -m32 -Os -march=athlon64' )
release64 = Environment( CXX = 'g++ -O2 -march=athlon64' )
debug32 = Environment( CXX = 'g++ -m32 -O0 -ggdb -W' )
debug64 = Environment( CXX = 'g++ -O0 -ggdb -W' )
debug_optimized = Environment( CXX = 'g++ -O2 -ggdb -W' )

release = debug64
#release = release64
#release = debug64
release = debug_optimized

release.SharedLibrary('hl-sha', [ 'hashlib/hl_sha1.cpp',
'hashlib/hl_sha1wrapper.cpp', 'hashlib/hl_sha256.cpp',
Expand All @@ -21,7 +22,7 @@ release.SharedLibrary('soul', 'soul.cpp')
release.SharedLibrary('theritory', 'theritory.cpp')
release.SharedLibrary('world', 'world.cpp')
release.SharedLibrary('job', 'job.cpp')
release.Program('world' , 'main.cpp',
release.Program('main' , 'main2.cpp',
LIBS=[ 'boost_thread', 'boost_filesystem', 'hl-sha', 'boost_serialization',
'job', 'character', 'coordinates',
'item', 'map', 'place', 'soul', 'theritory',
Expand Down
21 changes: 20 additions & 1 deletion character.cpp
Expand Up @@ -13,6 +13,12 @@
Ccharacter::Ccharacter( std::string new_name ) {
name = new_name; // creature name
race = human; //(0)
for ( int i = 0; i < 50; ++i ) {
items[ i ] = NULL;
}
for ( int i = 0; i < 250; ++i ) {
private_box[ i ] = NULL;
}
base_health = ( ( race * 100 ) + ( rand() % 10 ) ) + 100;
health = base_health + ( rand() % 125 ) - 75;
dead = false;
Expand All @@ -22,12 +28,18 @@ Ccharacter::Ccharacter( std::string new_name ) {
dexterity = 0;
luck = ( rand() % 21 ) - 10;
mind_strength = 0; // creature properties

} // creature properties

Ccharacter::Ccharacter( Eraces born_race, std::string new_name ) {
name = new_name;
race = born_race; //(0)
for ( int i = 0; i < 50; ++i ) {
items[ i ] = NULL;
}
for ( int i = 0; i < 250; ++i ) {
private_box[ i ] = NULL;
}
base_health = ( ( race * 100 ) + ( rand() % 10 ) ) + 100;
health = base_health + ( rand() % 125 ) - 75 ;
dead = false;
Expand Down Expand Up @@ -63,6 +75,13 @@ Ccharacter::Ccharacter( Eraces born_race, std::string new_name ) {
} //obiekt npc'a/ postaci gracza/ potwora

Ccharacter::~Ccharacter() {
/* for ( int i = 0; i < 50; ++i ) {
items[ i ] = NULL;
}
for ( int i = 0; i < 250; ++i ) {
private_box[ i ] = NULL;
}
*/
}

void Ccharacter::kill() {
Expand Down
15 changes: 6 additions & 9 deletions character.h
Expand Up @@ -37,8 +37,8 @@ enum Eraces {

class Ccharacter {
public:
Ccharacter( std::string new_name = "Zbigniew Żółć" ); //domyslnie tworzony jest czlowiek
Ccharacter( Eraces born_race, std::string new_name = "Zbigniew Żółć" ); //podajemy rase postaci
Ccharacter( std::string new_name = "Zbigniew Zolc" ); //domyslnie tworzony jest czlowiek
Ccharacter( Eraces born_race, std::string new_name = "Zbigniew Zolc" ); //podajemy rase postaci
~Ccharacter();
bool dead;
void kill();
Expand All @@ -50,18 +50,15 @@ class Ccharacter {
intelligence,
strength,
dexterity,
instinct, // instynkt im wyzszy tym postac bardziej potrafi wyczuc jakie ma szanse z przeciwnikiem :}
mind_strength;//cechy postaci
uint64_t gold;
uint32_t age; // wiek postaci
int32_t luck; //szczescie moze byc -
Ccoordinates pos; //pozycja postaci w swiecie
// Cbackpack backpack; //plecak
int16_t luck; //szczescie moze byc -
Ccoordinatese position; //pozycja postaci w swiecie
Csoul soul; // aktualna dusza :}
Eraces race;
//std::list<Citem> items;
Citem items[50];
Citem private_box[250];
Citem* items[50];
Citem* private_box[250];
}; //obiekt npc'a/ postaci gracza/ potwora

#endif //_CCHARACTER_H_
2 changes: 1 addition & 1 deletion config.h
Expand Up @@ -12,7 +12,7 @@

#include <string>

#define DEBUG
//#define DEBUG
#define RUBY_LOCAL_INSTALL // if defined then we'll look for headers in /usr/local instead of /usr
// TODO: #define RUBY_EMB // if defined we'll use Ruby As Embeeded Scripting Language

Expand Down
180 changes: 0 additions & 180 deletions cppcomplete.tags

This file was deleted.

3 changes: 2 additions & 1 deletion docs/README.TXT
@@ -1,5 +1,6 @@
project requirements:

scons
libboost-threads
g++ 4.2 ( with OpenMP support )
libboost-serialization
libboost-filesystem
Binary file added docs/multithreading_basics.pdf
Binary file not shown.
Binary file added docs/openmp.pdf
Binary file not shown.

0 comments on commit c58b410

Please sign in to comment.