Browse Source

Iteratoren werden jetzt verwendet

Kolja Strohm 6 years ago
parent
commit
a4ad59718d

+ 3 - 3
KSGClient/Leser/KartenLeser.cpp

@@ -6,16 +6,16 @@
 #include <Bild.h>
 #include <Punkt.h>
 
-KartenLeser KartenLeser::instance;
+KartenLeser *KartenLeser::instance = new KartenLeser();
 
 KartenLeser *KartenLeser::getInstance()
 {
-    return instance.getThis();
+    return instance->getThis();
 }
 
 void KartenLeser::cleanUp()
 {
-    instance = KartenLeser();
+    instance->release();
 }
 
 KartenLeser &KartenLeser::operator=( const KartenLeser &l )

+ 1 - 1
KSGClient/Leser/KartenLeser.h

@@ -17,7 +17,7 @@ private:
     Critical cs;
 	int ref;
 
-    static KartenLeser instance;
+    static KartenLeser *instance;
     // Konstruktor
     KartenLeser();
 

+ 20 - 20
KSGClient/NachLogin/Editor/Karte/Dateien/KEDModel2DEditor.cpp

@@ -151,32 +151,32 @@ void PolygonData::removeVertex( int num )
 
 void PolygonData::nachLinks( float num )
 {
-    for( auto *i = &vd->getArray(); i && i->set; i = i->next )
-        i->var->nachLinks( num );
+    for( auto i = vd->getIterator(); i; i++ )
+        i->nachLinks( num );
 }
 
 void PolygonData::nachOben( float num )
 {
-    for( auto *i = &vd->getArray(); i && i->set; i = i->next )
-        i->var->nachOben( num );
+    for( auto i = vd->getIterator(); i; i++ )
+        i->nachOben( num );
 }
 
 void PolygonData::saveTextur( Punkt tPos, Punkt tGr )
 {
-    for( auto *i = &vd->getArray(); i && i->set; i = i->next )
-        i->var->saveTextur( tPos, tGr );
+    for( auto i = vd->getIterator(); i; i++ )
+        i->saveTextur( tPos, tGr );
 }
 
 void PolygonData::select( Punkt p1, Punkt p2 )
 {
-    for( auto *i = &vd->getArray(); i && i->set; i = i->next )
-        i->var->select( p1, p2 );
+    for( auto i = vd->getIterator(); i; i++ )
+        i->select( p1, p2 );
 }
 
 void PolygonData::deSelect()
 {
-    for( auto *i = &vd->getArray(); i && i->set; i = i->next )
-        i->var->deSelect();
+    for( auto i = vd->getIterator(); i; i++ )
+        i->deSelect();
 }
 
 void PolygonData::setSichtbar( bool s )
@@ -309,14 +309,14 @@ void Data::selectPolygon( int num )
 
 void Data::nachLinks( float num )
 {
-    for( auto *i = &pd->getArray(); i && i->set; i = i->next )
-        i->var->nachLinks( num );
+    for( auto i = pd->getIterator(); i; i++ )
+        i->nachLinks( num );
 }
 
 void Data::nachOben( float num )
 {
-    for( auto *i = &pd->getArray(); i && i->set; i = i->next )
-        i->var->nachOben( num );
+    for( auto i = pd->getIterator(); i; i++ )
+        i->nachOben( num );
 }
 
 void Data::tNachLinks( int num )
@@ -347,8 +347,8 @@ void Data::saveTextur()
 {
     if( !rTextur )
         return;
-    for( auto *i = &pd->getArray(); i && i->set; i = i->next )
-        i->var->saveTextur( tPos, textur->getSize() );
+    for( auto i = pd->getIterator(); i; i++ )
+        i->saveTextur( tPos, textur->getSize() );
 }
 
 void Data::setTextur( Bild *t )
@@ -368,14 +368,14 @@ void Data::setTextur( Bild *t )
 
 void Data::select( Punkt p1, Punkt p2 )
 {
-    for( auto *i = &pd->getArray(); i && i->set; i = i->next )
-        i->var->select( p1, p2 );
+    for( auto i = pd->getIterator(); i; i++ )
+        i->select( p1, p2 );
 }
 
 void Data::deSelect()
 {
-    for( auto *i = &pd->getArray(); i && i->set; i = i->next )
-        i->var->deSelect();
+    for( auto i = pd->getIterator(); i; i++ )
+        i->deSelect();
 }
 
 // constant

+ 1 - 1
KSGClient/Start/Start.cpp

@@ -108,7 +108,7 @@ private:
 int KSGStart Framework::Start( Startparam p )
 {
 #ifdef _DEBUG
-    static OutputDebugStringBuf<char, std::char_traits<char>> charDebugOutput;
+    OutputDebugStringBuf<char, std::char_traits<char>> charDebugOutput;
     std::cout.rdbuf( &charDebugOutput );
 #endif
     Network::Start( 50 );