12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526 |
- #include "AccountHistorie.h"
- #include "AccountHistorieDaten.h"
- #include "../../../Global/Initialisierung.h"
- #include "../../../Leser/KartenLeser.h"
- #include "../../../Global/Variablen.h"
- #include <Text.h>
- #include <Rahmen.h>
- #include <DateiSystem.h>
- #include <Zeit.h>
- #include <Punkt.h>
- typedef AccountHistorieStatistikV* ( *AHSSDLLStart )( void );
- typedef AufzeichnungV* ( *AHSADLLStart )( void );
- AHSpielStatistik::AHSpielStatistik( Schrift *schrift )
- : Thread(),
- schrift( schrift )
- {
- statistikF = initFenster( 10, 40, 780, 450, schrift, Fenster::Style::Sichtbar | Fenster::Style::Titel | Fenster::Style::TitelBuffered | Fenster::Style::Rahmen, "Spiel Ergebnis" );
- laden = (Animation2D*)ladeAnimation->dublizieren();
- laden->setSichtbar( 0 );
- laden->setPosition( 380, 245 );
- dllName = new Text( "" );
- dllHandle = 0;
- alpha = 0;
- sichtbar = 0;
- statistik = 0;
- tickVal = 0;
- ref = 1;
- }
- AHSpielStatistik::~AHSpielStatistik()
- {
- statistikF->release();
- if( dllHandle )
- reset();
- dllName->release();
- schrift->release();
- laden->release();
- }
- void AHSpielStatistik::reset()
- {
- if( run )
- warteAufThread( INFINITE );
- if( dllHandle )
- {
- if( statistik )
- statistik = statistik->release();
- dllDateien->releaseDLL( *dllName );
- dllHandle = 0;
- }
- }
- bool AHSpielStatistik::ladeDaten( int spielId, int karteId )
- {
- if( dllHandle )
- reset();
- KartenLeser *reader = new KartenLeser();
- reader->setKarteId( karteId );
- Text *pfad = reader->getSpielPfad();
- if( !pfad )
- {
- nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( reader->getLetzterFehler() ), new Text( "Ok" ) );
- reader->release();
- return 0;
- }
- pfad->append( "bin/" );
- Text *spielArtName = reader->getSpielName();
- if( !spielArtName )
- {
- nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( reader->getLetzterFehler() ), new Text( "Ok" ) );
- reader->release();
- pfad->release();
- return 0;
- }
- pfad->append( spielArtName->getText() );
- pfad->append( ".dll" );
- reader->release();
- dllName->setText( "Spiele/" );
- dllName->append( spielArtName->getText() );
- dllName->append( ".dll" );
- spielArtName->release();
- dllHandle = dllDateien->ladeDLL( *dllName, *pfad );
- if( !dllHandle )
- {
- Text *msg = new Text( "Die DLL Datei '" );
- msg->append( pfad->getText() );
- msg->append( "' konnte nicht geladen werden." );
- nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), msg, new Text( "Ok" ) );
- pfad->release();
- return 0;
- }
- AHSSDLLStart startFunk = (AHSSDLLStart)GetProcAddress( dllHandle, "GetAccountHistorieStatistik" );
- if( !startFunk )
- {
- if( dllHandle )
- {
- dllDateien->releaseDLL( *dllName );
- dllHandle = 0;
- }
- Text *msg = new Text( "Die Funktion 'GetAccountHistorieStatistik' konnte in der DLL Datei '" );
- msg->append( pfad->getText() );
- msg->append( "' nicht gefunden werden." );
- nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), msg, new Text( "Ok" ) );
- pfad->release();
- return 0;
- }
- pfad->release();
- statistik = startFunk();
- if( !statistik )
- {
- if( dllHandle )
- {
- dllDateien->releaseDLL( *dllName );
- dllHandle = 0;
- }
- nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( "Für diese Spielart ist keine genauere Ansicht der Spiel Ergebnisse verfügbar." ), new Text( "Ok" ) );
- return 0;
- }
- this->spielId = spielId;
- statistik->setSchrift( schrift->getThis() );
- statistik->setBildschirm( hauptScreen->getThis() );
- start();
- return 1;
- }
- void AHSpielStatistik::thread()
- {
- laden->setSichtbar( 1 );
- if( !historieKlient->downloadSpielHistorie( spielId ) )
- nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( historieKlient->getLetzterFehler() ), new Text( "Ok" ) );
- statistik->ladeDaten( spielId );
- laden->setSichtbar( 0 );
- if( sichtbar )
- statistik->setSichtbar( 1 );
- run = 0;
- }
- void AHSpielStatistik::setPosition( int x, int y )
- {
- statistikF->setPosition( x, y );
- }
- void AHSpielStatistik::setSichtbar( bool sichtbar )
- {
- if( !statistik )
- return;
- if( !run )
- statistik->setSichtbar( sichtbar );
- this->sichtbar = sichtbar;
- if( sichtbar && !alpha )
- alpha = 1;
- }
- void AHSpielStatistik::doMausEreignis( MausEreignis &me )
- {
- if( !statistik || alpha != 255 )
- return;
- me.mx -= 1 + statistikF->getX();
- me.my -= 20 + statistikF->getY();
- statistik->doMausEreignis( me );
- if( statistik->wurdeGeschlossen() )
- setSichtbar( 0 );
- me.mx += 1 + statistikF->getX();
- me.my += 20 + statistikF->getY();
- }
- void AHSpielStatistik::doTastaturEreignis( TastaturEreignis &te )
- {
- if( !statistik || alpha != 255 )
- return;
- statistik->doTastaturEreignis( te );
- }
- bool AHSpielStatistik::tick( double tickVal )
- {
- if( !statistik || !alpha )
- return 0;
- bool ret = statistik->tick( tickVal );
- ret |= laden->tick( tickVal );
- this->tickVal += tickVal * 150;
- int val = ( int )this->tickVal;
- this->tickVal -= val;
- if( val )
- {
- if( sichtbar && alpha != 255 )
- {
- if( alpha + val > 255 )
- alpha = 255;
- else
- alpha += (unsigned char)val;
- ret = 1;
- }
- if( !sichtbar && alpha )
- {
- if( alpha - val < 0 )
- alpha = 0;
- else
- alpha -= (unsigned char)val;
- if( !alpha && statistik->istNochSichtbar() )
- alpha = 1;
- ret = 1;
- }
- }
- return ret;
- }
- void AHSpielStatistik::render( Bild &zRObj )
- {
- if( !statistik || !alpha )
- return;
- zRObj.setAlpha( alpha );
- statistikF->render( zRObj );
- if( !zRObj.setDrawOptions( statistikF->getX() + 1, statistikF->getY() + 21, statistikF->getBreite() - 2, statistikF->getHeight() - 22 ) )
- {
- zRObj.releaseAlpha();
- return;
- }
- statistik->render( zRObj );
- zRObj.releaseDrawOptions();
- laden->render( zRObj );
- zRObj.releaseAlpha();
- }
- bool AHSpielStatistik::istNochSichtbar() const
- {
- if( alpha )
- return 1;
- return statistik ? statistik->istNochSichtbar() : 0;
- }
- AHSpielStatistik *AHSpielStatistik::getThis()
- {
- ref++;
- return this;
- }
- AHSpielStatistik *AHSpielStatistik::release()
- {
- ref--;
- if( !ref )
- delete this;
- return 0;
- }
- AHSpielVideo::AHSpielVideo( Schrift *schrift )
- : Thread(),
- schrift( schrift )
- {
- videoF = initFenster( 10, 40, 780, 450, schrift, Fenster::Style::Sichtbar | Fenster::Style::Titel | Fenster::Style::TitelBuffered | Fenster::Style::Rahmen, "Spiel Aufzeichnung" );
- laden = (Animation2D*)ladeAnimation->dublizieren();
- laden->setSichtbar( 0 );
- laden->setPosition( 380, 245 );
- dllName = new Text( "" );
- dllHandle = 0;
- alpha = 0;
- sichtbar = 0;
- video = 0;
- tickVal = 0;
- ref = 1;
- }
- AHSpielVideo::~AHSpielVideo()
- {
- videoF->release();
- if( dllHandle )
- reset();
- dllName->release();
- schrift->release();
- laden->release();
- }
- void AHSpielVideo::reset()
- {
- if( run )
- warteAufThread( INFINITE );
- if( dllHandle )
- {
- if( video )
- video = video->release();
- dllDateien->releaseDLL( *dllName );
- dllHandle = 0;
- }
- }
- bool AHSpielVideo::ladeDaten( int spielId, int karteId )
- {
- if( dllHandle )
- reset();
- KartenLeser *reader = new KartenLeser();
- reader->setKarteId( karteId );
- Text *pfad = reader->getSpielPfad();
- if( !pfad )
- {
- nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( reader->getLetzterFehler() ), new Text( "Ok" ) );
- reader->release();
- return 0;
- }
- pfad->append( "bin/" );
- Text *spielArtName = reader->getSpielName();
- if( !spielArtName )
- {
- nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( reader->getLetzterFehler() ), new Text( "Ok" ) );
- reader->release();
- pfad->release();
- return 0;
- }
- pfad->append( spielArtName->getText() );
- pfad->append( ".dll" );
- reader->release();
- dllName->setText( "Spiele/" );
- dllName->append( spielArtName->getText() );
- dllName->append( ".dll" );
- spielArtName->release();
- dllHandle = dllDateien->ladeDLL( *dllName, *pfad );
- if( !dllHandle )
- {
- Text *msg = new Text( "Die DLL Datei '" );
- msg->append( pfad->getText() );
- msg->append( "' konnte nicht geladen werden." );
- nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), msg, new Text( "Ok" ) );
- pfad->release();
- return 0;
- }
- AHSADLLStart startFunk = (AHSADLLStart)GetProcAddress( dllHandle, "GetAufzeichnung" );
- if( !startFunk )
- {
- if( dllHandle )
- {
- dllDateien->releaseDLL( *dllName );
- dllHandle = 0;
- }
- Text *msg = new Text( "Die Funktion 'GetAufzeichnung' konnte in der DLL Datei '" );
- msg->append( pfad->getText() );
- msg->append( "' nicht gefunden werden." );
- nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), msg, new Text( "Ok" ) );
- pfad->release();
- return 0;
- }
- pfad->release();
- video = startFunk();
- if( !video )
- {
- if( dllHandle )
- {
- dllDateien->releaseDLL( *dllName );
- dllHandle = 0;
- }
- nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( "Für diese Spielart ist keine Aufzeichnung verfügbar." ), new Text( "Ok" ) );
- return 0;
- }
- this->spielId = spielId;
- video->setSchrift( schrift->getThis() );
- video->setBildschirm( hauptScreen->getThis() );
- start();
- return 1;
- }
- void AHSpielVideo::thread()
- {
- laden->setSichtbar( 1 );
- if( !historieKlient->downloadSpielHistorie( spielId ) )
- nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( historieKlient->getLetzterFehler() ), new Text( "Ok" ) );
- video->ladeSpiel( spielId );
- laden->setSichtbar( 0 );
- if( sichtbar )
- {
- nachLogin->setSpielAufzeichnung( video->getThis() );
- aktion = 7;
- }
- run = 0;
- }
- void AHSpielVideo::setSichtbar( bool sichtbar )
- {
- if( !video )
- return;
- if( sichtbar && !run )
- {
- nachLogin->setSpielAufzeichnung( video->getThis() );
- aktion = 7;
- }
- this->sichtbar = sichtbar;
- if( sichtbar && !alpha )
- alpha = 1;
- }
- bool AHSpielVideo::tick( double tickVal )
- {
- if( !video || !alpha )
- return 0;
- if( video->hatVerlassen( 0 ) && sichtbar )
- setSichtbar( 0 );
- bool ret = laden->tick( tickVal );
- this->tickVal += tickVal * 150;
- int val = ( int )this->tickVal;
- this->tickVal -= val;
- if( val )
- {
- if( sichtbar && alpha != 255 )
- {
- if( alpha + val > 255 )
- alpha = 255;
- else
- alpha += (unsigned char)val;
- ret = 1;
- }
- if( !sichtbar && alpha )
- {
- if( alpha - val < 0 )
- alpha = 0;
- else
- alpha -= (unsigned char)val;
- ret = 1;
- }
- }
- return ret;
- }
- void AHSpielVideo::render( Bild &zRObj )
- {
- if( !video || !alpha )
- return;
- if( !zRObj.setDrawOptions( 0, 0, videoF->getBreite() + 10, videoF->getHeight() + 40 ) )
- return;
- zRObj.setAlpha( alpha );
- videoF->render( zRObj );
- laden->render( zRObj );
- zRObj.releaseAlpha();
- zRObj.releaseDrawOptions();
- }
- bool AHSpielVideo::istNochSichtbar() const
- {
- return alpha != 0;
- }
- AHSpielVideo *AHSpielVideo::getThis()
- {
- ref++;
- return this;
- }
- AHSpielVideo *AHSpielVideo::release()
- {
- ref--;
- if( !ref )
- delete this;
- return 0;
- }
- AHSLETeamListeSpieler::AHSLETeamListeSpieler( Schrift *zSchrift, char *name, int punkte, char *status, int farbe, int br )
- : nameTF( initTextFeld( 5, 0, 100, 20, zSchrift, TextFeld::Style::Text | TextFeld::Style::Center, name ) ),
- punkteTF( initTextFeld( 110, 0, 100, 20, zSchrift, TextFeld::Style::Text | TextFeld::Style::Center, Text( "Punkte: " ) += punkte ) ),
- statusTF( initTextFeld( 215, 0, 100, 20, zSchrift, TextFeld::Style::Text | TextFeld::Style::Center, status ) ),
- ram( new LRahmen() ),
- ref( 1 )
- {
- zSchrift->lock();
- zSchrift->setSchriftSize( 12 );
- nameTF->setSize( zSchrift->getTextBreite( nameTF->zText() ) + 5, 20 );
- punkteTF->setSize( zSchrift->getTextBreite( punkteTF->zText() ) + 5, 20 );
- statusTF->setSize( zSchrift->getTextBreite( statusTF->zText() ) + 5, 20 );
- zSchrift->unlock();
- if( nameTF->getBreite() > 100 )
- punkteTF->setPosition( 10 + nameTF->getBreite(), 0 );
- if( punkteTF->getX() + punkteTF->getBreite() > 210 )
- statusTF->setPosition( punkteTF->getX() + punkteTF->getBreite() + 5, 0 );
- ram->setFarbe( farbe );
- ram->setSize( br, 20 );
- ram->setRamenBreite( 1 );
- }
- AHSLETeamListeSpieler::~AHSLETeamListeSpieler()
- {
- nameTF->release();
- punkteTF->release();
- statusTF->release();
- ram->release();
- }
- void AHSLETeamListeSpieler::render( int yOff, Bild &zRObj )
- {
- if( !zRObj.setDrawOptions( 2, yOff, ram->getBreite(), ram->getHeight() ) )
- return;
- nameTF->render( zRObj );
- punkteTF->render( zRObj );
- statusTF->render( zRObj );
- ram->render( zRObj );
- zRObj.releaseDrawOptions();
- }
- AHSLETeamListeSpieler *AHSLETeamListeSpieler::getThis()
- {
- ref++;
- return this;
- }
- AHSLETeamListeSpieler *AHSLETeamListeSpieler::release()
- {
- ref--;
- if( !ref )
- delete this;
- return 0;
- }
- AHSLETeamListeTeam::AHSLETeamListeTeam( Schrift *zSchrift, char *name, int sAnz, char *status, int farbe, int br )
- : nameTF( initTextFeld( 5, 0, 100, 20, zSchrift, TextFeld::Style::Text | TextFeld::Style::Center, name ) ),
- sAnzahlTF( initTextFeld( 110, 0, 100, 20, zSchrift, TextFeld::Style::Text | TextFeld::Style::Center, Text( "Spieleranzahl: " ) += sAnz ) ),
- statusTF( initTextFeld( 215, 0, 100, 20, zSchrift, TextFeld::Style::Text | TextFeld::Style::Center, status ) ),
- ram( new LRahmen() ),
- members( new RCArray< AHSLETeamListeSpieler >() ),
- ref( 1 )
- {
- zSchrift->lock();
- zSchrift->setSchriftSize( 12 );
- nameTF->setSize( zSchrift->getTextBreite( nameTF->zText() ) + 5, 20 );
- sAnzahlTF->setSize( zSchrift->getTextBreite( sAnzahlTF->zText() ) + 5, 20 );
- statusTF->setSize( zSchrift->getTextBreite( statusTF->zText() ) + 5, 20 );
- zSchrift->unlock();
- if( nameTF->getBreite() > 100 )
- sAnzahlTF->setPosition( 10 + nameTF->getBreite(), 0 );
- if( sAnzahlTF->getX() + sAnzahlTF->getBreite() > 210 )
- statusTF->setPosition( sAnzahlTF->getX() + sAnzahlTF->getBreite() + 5, 0 );
- ram->setFarbe( farbe );
- ram->setSize( br, 20 );
- ram->setRamenBreite( 1 );
- }
- AHSLETeamListeTeam::~AHSLETeamListeTeam()
- {
- nameTF->release();
- sAnzahlTF->release();
- statusTF->release();
- ram->release();
- members->release();
- }
- void AHSLETeamListeTeam::addSpieler( AHSLETeamListeSpieler *s )
- {
- members->add( s );
- int maxHö = 20;
- int anz = members->getEintragAnzahl();
- if( anz )
- maxHö += 4 + 20 * anz;
- ram->setSize( ram->getBreite(), maxHö );
- }
- void AHSLETeamListeTeam::render( int xOff, int yOff, Bild &zRObj )
- {
- if( !zRObj.setDrawOptions( xOff, yOff, ram->getBreite(), ram->getHeight() ) )
- return;
- nameTF->render( zRObj );
- sAnzahlTF->render( zRObj );
- statusTF->render( zRObj );
- ram->render( zRObj );
- yOff = 22;
- int anz = members->getEintragAnzahl();
- for( int i = 0; i < anz; i++ )
- {
- members->z( i )->render( yOff, zRObj );
- yOff += 20;
- }
- zRObj.releaseDrawOptions();
- }
- int AHSLETeamListeTeam::getHeight() const
- {
- return ram->getHeight();
- }
- AHSLETeamListeTeam *AHSLETeamListeTeam::getThis()
- {
- ref++;
- return this;
- }
- AHSLETeamListeTeam *AHSLETeamListeTeam::release()
- {
- ref--;
- if( !ref )
- delete this;
- return 0;
- }
- AHSLETeamListe::AHSLETeamListe( int xPos )
- : members( new RCArray< AHSLETeamListeTeam >() ),
- xPos( xPos ),
- ref( 1 )
- {
- }
- AHSLETeamListe::~AHSLETeamListe()
- {
- members->release();
- }
- void AHSLETeamListe::addTeam( AHSLETeamListeTeam *t )
- {
- members->add( t );
- }
- void AHSLETeamListe::render( Bild &zRObj )
- {
- int y = 25;
- int anz = members->getEintragAnzahl();
- for( int i = 0; i < anz; i++ )
- {
- members->z( i )->render( xPos, y, zRObj );
- y += members->z( i )->getHeight();
- }
- }
- int AHSLETeamListe::getHeight() const
- {
- int anz = members->getEintragAnzahl();
- int hö = 0;
- for( int i = 0; i < anz; i++ )
- hö += members->z( i )->getHeight();
- return hö;
- }
- int AHSLETeamListe::getBreite() const
- {
- return 730 - xPos;
- }
- AHSLETeamListe *AHSLETeamListe::getThis()
- {
- ref++;
- return this;
- }
- AHSLETeamListe *AHSLETeamListe::release()
- {
- ref--;
- if( !ref )
- delete this;
- return 0;
- }
- AHSpielListeEintrag::AHSpielListeEintrag( int id, int karteId, Schrift *zSchrift, char *spiel, char *karte, char *datum, char *status,
- char *dauer, char *spielStatus, char *gewinner, int sAnzahl )
- : spielTF( initTextFeld( 5, 0, 100, 20, zSchrift, TextFeld::Style::Text | TextFeld::Style::Center, Text( "Spiel: " ) += spiel ) ),
- karteTF( initTextFeld( 110, 0, 100, 20, zSchrift, TextFeld::Style::Text | TextFeld::Style::Center, Text( "Karte: " ) += karte ) ),
- datumTF( initTextFeld( 215, 0, 180, 20, zSchrift, TextFeld::Style::Text | TextFeld::Style::Center, Text( "Datum: " ) += datum ) ),
- statusTF( initTextFeld( 400, 0, 100, 20, zSchrift, TextFeld::Style::Text | TextFeld::Style::Center, Text( "Status: " ) += status ) ),
- spiel( new Text( spiel ) ),
- karte( new Text( karte ) ),
- datum( new Text( datum ) ),
- status( new Text( status ) ),
- detailsK( initKnopf( 715, 0, 20, 20, 0, 0, "" ) ),
- dauerTF( initTextFeld( 5, 25, 100, 20, zSchrift, TextFeld::Style::Text, Text( "Dauer: " ) += dauer ) ),
- spielStatusTF( initTextFeld( 5, 45, 100, 20, zSchrift, TextFeld::Style::Text, Text( "Status: " ) += spielStatus ) ),
- gewinnerTF( initTextFeld( 5, 65, 100, 20, zSchrift, TextFeld::Style::Text, Text( "Gewinner: " ) += gewinner ) ),
- sAnzahlTF( initTextFeld( 5, 85, 100, 20, zSchrift, TextFeld::Style::Text, Text( "Spieleranzahl: " ) += sAnzahl ) ),
- statistikK( initKnopf( 5, 105, 100, 20, zSchrift, Knopf::Style::Sichtbar, "Statistik" ) ),
- videoK( initKnopf( 5, 130, 100, 20, zSchrift, Knopf::Style::Sichtbar, "Aufzeichnung" ) ),
- liste( 0 ),
- ram( new LRahmen() ),
- ausklappen( bilder->get( "account.ltdb/ausklappen.png" ) ),
- einklappen( bilder->get( "account.ltdb/einklappen.png" ) ),
- id( id ),
- karteId( karteId ),
- tickVal( 0 ),
- aktion( 0 ),
- maxHö( 155 ),
- ref( 1 )
- {
- if( !einklappen )
- {
- LTDBDatei *datei = new LTDBDatei();
- datei->setDatei( new Text( "data/client/bilder/account.ltdb" ) );
- datei->leseDaten( 0 );
- einklappen = datei->laden( 0, new Text( "einklappen.png" ) );
- datei->release();
- bilder->add( "account.ltdb/einklappen.png", einklappen->getThis() );
- }
- if( !ausklappen )
- {
- LTDBDatei *datei = new LTDBDatei();
- datei->setDatei( new Text( "data/client/bilder/account.ltdb" ) );
- datei->leseDaten( 0 );
- ausklappen = datei->laden( 0, new Text( "ausklappen.png" ) );
- datei->release();
- bilder->add( "account.ltdb/ausklappen.png", ausklappen->getThis() );
- }
- detailsK->setStyle( Knopf::Style::Sichtbar | Knopf::Style::Erlaubt | Knopf::Style::Hintergrund | Knopf::Style::HAlpha | Knopf::Style::HBild | Knopf::Style::KlickBuffer );
- detailsK->setHintergrundBildZ( ausklappen->getThis() );
- initToolTip( detailsK, "Details anzeigen.", zSchrift->getThis(), hauptScreen );
- zSchrift->lock();
- zSchrift->setSchriftSize( 12 );
- spielTF->setSize( zSchrift->getTextBreite( spielTF->zText() ) + 5, 20 );
- karteTF->setSize( zSchrift->getTextBreite( karteTF->zText() ) + 5, 20 );
- datumTF->setSize( zSchrift->getTextBreite( datumTF->zText() ) + 5, 20 );
- statusTF->setSize( zSchrift->getTextBreite( statusTF->zText() ) + 5, 20 );
- dauerTF->setSize( zSchrift->getTextBreite( dauerTF->zText() ), 20 );
- spielStatusTF->setSize( zSchrift->getTextBreite( spielStatusTF->zText() ), 20 );
- gewinnerTF->setSize( zSchrift->getTextBreite( gewinnerTF->zText() ), 20 );
- sAnzahlTF->setSize( zSchrift->getTextBreite( sAnzahlTF->zText() ), 20 );
- zSchrift->unlock();
- if( spielTF->getBreite() > 100 )
- karteTF->setPosition( 10 + spielTF->getBreite(), 0 );
- if( karteTF->getX() + karteTF->getBreite() > 210 )
- datumTF->setPosition( karteTF->getX() + karteTF->getBreite() + 5, 0 );
- if( datumTF->getX() + datumTF->getBreite() > 395 )
- statusTF->setPosition( datumTF->getX() + datumTF->getBreite() + 5, 0 );
- ram->setFarbe( 0xFFFFFFFF );
- ram->setSize( 735, 20 );
- ram->setRamenBreite( 1 );
- int br = dauerTF->getBreite();
- br = br > spielStatusTF->getBreite() ? br : spielStatusTF->getBreite();
- br = br > gewinnerTF->getBreite() ? br : gewinnerTF->getBreite();
- br = br > sAnzahlTF->getBreite() ? br : sAnzahlTF->getBreite();
- statistikK->setSize( br, statistikK->getHeight() );
- videoK->setSize( br, videoK->getHeight() );
- liste = new AHSLETeamListe( br + 10 );
- }
- AHSpielListeEintrag::~AHSpielListeEintrag()
- {
- spielTF->release();
- karteTF->release();
- datumTF->release();
- statusTF->release();
- spiel->release();
- karte->release();
- datum->release();
- status->release();
- detailsK->release();
- dauerTF->release();
- spielStatusTF->release();
- gewinnerTF->release();
- sAnzahlTF->release();
- statistikK->release();
- videoK->release();
- liste->release();
- ram->release();
- einklappen->release();
- ausklappen->release();
- }
- void AHSpielListeEintrag::addTeam( AHSLETeamListeTeam *t )
- {
- liste->addTeam( t );
- maxHö = liste->getHeight();
- maxHö = 155 > maxHö + 30 ? 155 : maxHö + 30;
- }
- bool AHSpielListeEintrag::tick( double tickVal )
- {
- bool ret = detailsK->tick( tickVal );
- ret |= statistikK->tick( tickVal );
- ret |= videoK->tick( tickVal );
- this->tickVal += tickVal * 150;
- int val = ( int )this->tickVal;
- this->tickVal -= val;
- if( val )
- {
- if( detailsK->zHintergrundBild() == ausklappen && ram->getHeight() != 20 )
- {
- if( ram->getHeight() - val < 20 )
- ram->setSize( ram->getBreite(), 20 );
- else
- ram->setSize( ram->getBreite(), ram->getHeight() - val );
- ret = 1;
- }
- if( detailsK->zHintergrundBild() == einklappen )
- {
- if( ram->getHeight() > maxHö )
- {
- if( ram->getHeight() - val < maxHö )
- ram->setSize( ram->getBreite(), maxHö );
- else
- ram->setSize( ram->getBreite(), ram->getHeight() - val );
- ret = 1;
- }
- if( ram->getHeight() < maxHö )
- {
- if( ram->getHeight() + val > maxHö )
- ram->setSize( ram->getBreite(), maxHö );
- else
- ram->setSize( ram->getBreite(), ram->getHeight() + val );
- ret = 1;
- }
- }
- }
- return ret;
- }
- void AHSpielListeEintrag::doMausEreignis( MausEreignis &me )
- {
- bool meVera = 0;
- bool meVeraTmp = 0;
- if( me.mx < 0 || me.my < 0 || me.mx >= ram->getBreite() || me.my >= ram->getHeight() )
- {
- meVeraTmp = me.verarbeitet;
- me.verarbeitet = 1;
- meVera = 1;
- }
- int vera = me.verarbeitet;
- detailsK->doMausEreignis( me );
- if( !vera && me.verarbeitet && me.id == ME_RLinks )
- {
- if( detailsK->zHintergrundBild() == einklappen )
- detailsK->setHintergrundBildZ( ausklappen->getThis() );
- else
- detailsK->setHintergrundBildZ( einklappen->getThis() );
- }
- vera = me.verarbeitet;
- statistikK->doMausEreignis( me );
- if( !vera && me.verarbeitet && me.id == ME_RLinks )
- aktion = 1;
- vera = me.verarbeitet;
- videoK->doMausEreignis( me );
- if( !vera && me.verarbeitet && me.id == ME_RLinks )
- aktion = 2;
- if( meVera )
- me.verarbeitet = meVeraTmp;
- }
- void AHSpielListeEintrag::render( int yOff, Bild &zRObj )
- {
- if( !zRObj.setDrawOptions( 5, yOff, ram->getBreite(), ram->getHeight() ) )
- return;
- ram->render( zRObj );
- if( ram->getHeight() > 20 )
- zRObj.drawLinieH( 1, 20, ram->getBreite() - 2, ram->getFarbe() );
- if( !zRObj.setDrawOptions( 1, 1, ram->getBreite() - 2, ram->getHeight() - 2 ) )
- {
- zRObj.releaseDrawOptions();
- return;
- }
- spielTF->render( zRObj );
- karteTF->render( zRObj );
- datumTF->render( zRObj );
- statusTF->render( zRObj );
- detailsK->render( zRObj );
- dauerTF->render( zRObj );
- spielStatusTF->render( zRObj );
- gewinnerTF->render( zRObj );
- sAnzahlTF->render( zRObj );
- statistikK->render( zRObj );
- videoK->render( zRObj );
- liste->render( zRObj );
- zRObj.releaseDrawOptions();
- zRObj.releaseDrawOptions();
- }
- int AHSpielListeEintrag::getAktion()
- {
- int ret = aktion;
- aktion = 0;
- return ret;
- }
- int AHSpielListeEintrag::getKarteId() const
- {
- return karteId;
- }
- int AHSpielListeEintrag::getHeight() const
- {
- return ram->getHeight();
- }
- int AHSpielListeEintrag::getId() const
- {
- return id;
- }
- int AHSpielListeEintrag::getListeBreite() const
- {
- return liste->getBreite();
- }
- Text *AHSpielListeEintrag::zSpiel() const
- {
- return spiel;
- }
- Text *AHSpielListeEintrag::zKarte() const
- {
- return karte;
- }
- Text *AHSpielListeEintrag::zDatum() const
- {
- return datum;
- }
- Text *AHSpielListeEintrag::zStatus() const
- {
- return status;
- }
- AHSpielListeEintrag *AHSpielListeEintrag::getThis()
- {
- ref++;
- return this;
- }
- AHSpielListeEintrag *AHSpielListeEintrag::release()
- {
- ref--;
- if( !ref )
- delete this;
- return 0;
- }
- AHSpielListe::AHSpielListe()
- : Zeichnung(),
- ram( new LRahmen() ),
- scroll( new VScrollBar() ),
- members( new RCArray< AHSpielListeEintrag >() ),
- sortSpalte( new Text( "Spiel" ) ),
- sortAbsteigend( 0 ),
- ref( 1 )
- {
- pos = Punkt( 10, 40 );
- ram->setFarbe( 0xFFFFFFFF );
- ram->setRamenBreite( 1 );
- ram->setSize( 760, 380 );
- scroll->update( 0, 380 );
- }
- AHSpielListe::~AHSpielListe()
- {
- ram->release();
- scroll->release();
- members->release();
- sortSpalte->release();
- }
- int AHSpielListe::getReihenfolge( int *arr )
- {
- lockZeichnung();
- int anz = members->getEintragAnzahl();
- if( !anz )
- {
- unlockZeichnung();
- return 0;
- }
- int ret = 0;
- bool *fertig = new bool[ anz ];
- ZeroMemory( fertig, anz );
- for( int i = 0; i < anz; i++ )
- {
- int index = -1;
- Text minMaxT;
- Zeit minMaxZ;
- for( int j = 0; j < anz; j++ )
- {
- AHSpielListeEintrag *tmp = members->z( j );
- if( sortSpalte->istGleich( "Spiel" ) && !fertig[ j ] && ( index < 0 ||
- ( sortAbsteigend && *tmp->zSpiel() > minMaxT ) || ( !sortAbsteigend && *tmp->zSpiel() < minMaxT ) ) )
- {
- minMaxT = tmp->zSpiel()->getText();
- index = j;
- }
- else if( sortSpalte->istGleich( "Karte" ) && !fertig[ j ] && ( index < 0 ||
- ( sortAbsteigend && *tmp->zKarte() > minMaxT ) || ( !sortAbsteigend && *tmp->zKarte() < minMaxT ) ) )
- {
- minMaxT = tmp->zKarte()->getText();
- index = j;
- }
- else if( sortSpalte->istGleich( "Datum" ) && !fertig[ j ] && ( index < 0 ||
- ( sortAbsteigend && minMaxZ.istKleiner( "y-m-d h:i", tmp->zDatum()->getText() ) ) ||
- ( !sortAbsteigend && minMaxZ.istLater( "y-m-d h:i", tmp->zDatum()->getText() ) ) ) )
- {
- minMaxZ.setZeit( "y-m-d h:i", tmp->zDatum()->getText() );
- index = j;
- }
- else if( sortSpalte->istGleich( "Status" ) && !fertig[ j ] && ( index < 0 ||
- ( sortAbsteigend && *tmp->zStatus() > minMaxT ) || ( !sortAbsteigend && *tmp->zStatus() < minMaxT ) ) )
- {
- minMaxT = tmp->zStatus()->getText();
- index = j;
- }
- }
- if( index < 0 )
- break;
- fertig[ index ] = 1;
- arr[ ret ] = index;
- ret++;
- }
- delete[] fertig;
- unlockZeichnung();
- return ret;
- }
- void AHSpielListe::setSortSpalte( char *sp )
- {
- lockZeichnung();
- sortSpalte->setText( sp );
- unlockZeichnung();
- }
- void AHSpielListe::setSortRichtung( bool absteigend )
- {
- sortAbsteigend = absteigend;
- }
- void AHSpielListe::reset()
- {
- lockZeichnung();
- members->leeren();
- unlockZeichnung();
- }
- void AHSpielListe::addSpiel( AHSpielListeEintrag *s )
- {
- lockZeichnung();
- members->add( s );
- unlockZeichnung();
- }
- bool AHSpielListe::tick( double tickVal )
- {
- bool ret = scroll->getRend();
- lockZeichnung();
- int anz = members->getEintragAnzahl();
- for( int i = 0; i < anz; i++ )
- ret |= members->z( i )->tick( tickVal );
- unlockZeichnung();
- return ret;
- }
- void AHSpielListe::doMausEreignis( MausEreignis &me )
- {
- bool vera = 0;
- if( me.mx - pos.x <= 0 || me.mx - pos.x >= ram->getBreite() || me.my - pos.y <= 0 || me.my - pos.y >= ram->getHeight() )
- {
- vera = 1;
- me.verarbeitet = 1;
- }
- int mx = me.mx, my = me.my;
- me.mx -= pos.x;
- me.my -= pos.y;
- scroll->doMausMessage( ram->getBreite() - 16, 1, 15, ram->getHeight() - 2, me );
- me.mx -= 5;
- me.my -= 5 - scroll->getScroll();
- lockZeichnung();
- int anz = members->getEintragAnzahl();
- int *rf = new int[ anz ];
- int rfAnz = getReihenfolge( rf );
- for( int i = 0; i < rfAnz; i++ )
- {
- members->z( rf[ i ] )->doMausEreignis( me );
- me.my -= members->z( rf[ i ] )->getHeight() + 5;
- }
- delete[] rf;
- unlockZeichnung();
- me.mx = mx, me.my = my;
- if( vera )
- me.verarbeitet = 0;
- }
- void AHSpielListe::render( Bild &zRObj )
- {
- if( !zRObj.setDrawOptions( pos, ram->getSize() ) )
- return;
- ram->render( zRObj );
- scroll->render( ram->getBreite() - 16, 1, 15, ram->getHeight() - 2, zRObj );
- if( !zRObj.setDrawOptions( 1, 1, ram->getBreite() - 15, ram->getHeight() - 2 ) )
- {
- zRObj.releaseDrawOptions();
- return;
- }
- int anzHö = 5;
- lockZeichnung();
- int anz = members->getEintragAnzahl();
- int *rf = new int[ anz ];
- int rfAnz = getReihenfolge( rf );
- for( int i = 0; i < rfAnz; i++ )
- {
- members->z( rf[ i ] )->render( anzHö - scroll->getScroll(), zRObj );
- anzHö += members->z( rf[ i ] )->getHeight() + 5;
- }
- delete[] rf;
- unlockZeichnung();
- scroll->update( anzHö, ram->getHeight() - 2 );
- zRObj.releaseDrawOptions();
- zRObj.releaseDrawOptions();
- }
- int AHSpielListe::getAktion( int *spielId, int *karteId ) const
- {
- int anz = members->getEintragAnzahl();
- for( int i = 0; i < anz; i++ )
- {
- int ak = members->z( i )->getAktion();
- if( ak )
- {
- *spielId = members->z( i )->getId();
- *karteId = members->z( i )->getKarteId();
- return ak;
- }
- }
- return 0;
- }
- AHSpielListe *AHSpielListe::getThis()
- {
- ref++;
- return this;
- }
- AHSpielListe *AHSpielListe::release()
- {
- ref--;
- if( !ref )
- delete this;
- return 0;
- }
- AccountHistorie::AccountHistorie( Schrift *zSchrift )
- : Thread(),
- schrift( zSchrift->getThis() ),
- historieF( initFenster( 810, 40, 780, 450, zSchrift, Fenster::Style::Sichtbar | Fenster::Style::Titel | Fenster::Style::TitelBuffered | Fenster::Style::Rahmen | Fenster::Style::Erlaubt, "Historie von " ) ),
- sortSpalte( initAuswahlBox( 10, 10, 150, 20, zSchrift, ABSTYLE, { "Spiel", "Karte", "Datum", "Status" } ) ),
- sortRichtung( initAuswahlBox( 170, 10, 150, 20, zSchrift, ABSTYLE, { "Aufwärts", "Abwärts" } ) ),
- liste( new AHSpielListe() ),
- statistik( new AHSpielStatistik( zSchrift->getThis() ) ),
- video( new AHSpielVideo( zSchrift->getThis() ) ),
- status( 0 ),
- accId( 0 ),
- animation( 0 ),
- alpha( 255 ),
- alpha2( 255 ),
- alpha3( 255 ),
- tickVal( 0 ),
- rend( 0 ),
- ref( 1 )
- {
- initToolTip( sortSpalte, "Wähle aus, nach welcher Spalte die\nTabelle sortiert werden soll.", zSchrift->getThis(), hauptScreen );
- initToolTip( sortRichtung, "Wähle aus, ob Aufwärts oder Abwärts\nsortiert werden soll.", zSchrift->getThis(), hauptScreen );
- historieF->addMember( liste );
- historieF->addMember( sortSpalte );
- historieF->addMember( sortRichtung );
- historieF->setMausEreignis( _ret1ME );
- }
- AccountHistorie::~AccountHistorie()
- {
- schrift->release();
- historieF->release();
- sortSpalte->release();
- sortRichtung->release();
- statistik->release();
- liste->release();
- video->release();
- }
- void AccountHistorie::reset()
- {
- liste->reset();
- statistik->reset();
- video->reset();
- }
- void AccountHistorie::ladeStatistik( int accId )
- {
- if( this->accId == accId )
- return;
- this->status = 0;
- if( run )
- {
- warteAufThread( 1000 );
- ende();
- }
- if( ( animation | 0x1 ) == animation )
- {
- animation |= 0x4;
- this->accId = accId;
- this->status = 1;
- return;
- }
- if( this->accId )
- reset();
- this->accId = accId;
- start();
- this->status = 1;
- }
- void AccountHistorie::thread()
- {
- Text *name = infoKlient->getSpielerName( accId );
- if( name )
- {
- name->insert( 0, "Historie von " );
- historieF->setTitel( *name );
- name->release();
- }
- AHDaten *daten = infoKlient->getSpielHistorieDaten( accId );
- int anz = daten->spiele->getEintragAnzahl();
- for( int i = 0; i < anz; i++ )
- {
- AHSpielDaten *spiel = daten->spiele->z( i );
- AHSpielListeEintrag *spielE = new AHSpielListeEintrag( spiel->id, spiel->karteId, schrift, *spiel->spiel, *spiel->karte,
- *spiel->datum, *spiel->status, *spiel->dauer,
- *spiel->spielStatus, *spiel->gewinner, spiel->sAnzahl );
- int tAnz = spiel->teams->getEintragAnzahl();
- for( int j = 0; j < tAnz; j++ )
- {
- AHSpielTeamDaten *team = spiel->teams->z( j );
- AHSLETeamListeTeam *teamE = new AHSLETeamListeTeam( schrift, *team->name, team->sAnzahl, *team->status,
- team->farbe, spielE->getListeBreite() );
- int sAnz = team->spieler->getEintragAnzahl();
- for( int k = 0; k < sAnz; k++ )
- {
- AHSpielSpielerDaten *spieler = team->spieler->z( k );
- AHSLETeamListeSpieler *spielerE = new AHSLETeamListeSpieler( schrift, *spieler->name, spieler->punkte, *spieler->status,
- spieler->farbe, spielE->getListeBreite() - 4 );
- teamE->addSpieler( spielerE );
- }
- spielE->addTeam( teamE );
- }
- liste->addSpiel( spielE );
- }
- daten->release();
- animation &= ~0x4;
- status = 2;
- run = 0;
- }
- void AccountHistorie::setSichtbar( bool sichtbar, bool nachRechts )
- {
- if( sichtbar )
- {
- if( ( animation | 0x1 ) != animation || ( ( nachRechts && ( animation | 0x2 ) != animation ) || !nachRechts && ( animation | 0x2 ) == animation ) )
- {
- if( nachRechts )
- historieF->setPosition( -810, 40 );
- else
- historieF->setPosition( 810, 40 );
- }
- animation |= 0x1;
- }
- else
- animation &= ~0x1;
- if( nachRechts )
- animation |= 0x2;
- else
- animation &= ~0x2;
- }
- bool AccountHistorie::tick( double zeit )
- {
- if( !statistik->istNochSichtbar() && !video->istNochSichtbar() )
- rend |= historieF->tick( zeit );
- rend |= statistik->tick( zeit );
- rend |= video->tick( zeit );
- tickVal += zeit;
- int valA = (int)( tickVal * 150 );
- int valB = (int)( tickVal * 500 );
- tickVal -= valA / 150.0;
- if( valA )
- {
- if( ( animation | 0x8 ) == animation && alpha2 )
- {
- if( alpha2 - valA <= 0 )
- {
- alpha2 = 0;
- statistik->setSichtbar( 1 );
- }
- else
- alpha2 -= valA;
- rend = 1;
- }
- if( ( animation | 0x8 ) != animation && alpha2 != 255 )
- {
- if( alpha2 + valA >= 255 )
- alpha2 = 255;
- else
- alpha2 += valA;
- rend = 1;
- }
- if( ( animation | 0x10 ) == animation && alpha3 )
- {
- if( alpha3 - valA <= 0 )
- {
- alpha3 = 0;
- video->setSichtbar( 1 );
- }
- else
- alpha3 -= valA;
- rend = 1;
- }
- if( ( animation | 0x10 ) != animation && alpha3 != 255 )
- {
- if( alpha3 + valA >= 255 )
- alpha3 = 255;
- else
- alpha3 += valA;
- rend = 1;
- }
- if( ( animation | 0x4 ) == animation && alpha )
- {
- if( alpha - valA <= 0 )
- alpha = 0;
- else
- alpha -= valA;
- rend = 1;
- if( !alpha )
- {
- reset();
- start();
- }
- }
- if( ( animation | 0x4 ) != animation && alpha != 255 )
- {
- if( alpha + valA >= 255 )
- alpha = 255;
- else
- alpha += valA;
- rend = 1;
- }
- }
- if( valB )
- {
- if( ( animation | 0x1 ) == animation )
- {
- if( ( animation | 0x2 ) == animation )
- {
- if( historieF->getX() != 10 )
- {
- if( historieF->getX() + valB > 10 )
- historieF->setPosition( 10, historieF->getY() );
- else
- historieF->setPosition( historieF->getX() + valB, historieF->getY() );
- statistik->setPosition( historieF->getX(), historieF->getY() );
- rend = 1;
- }
- }
- else
- {
- if( historieF->getX() != 10 )
- {
- if( historieF->getX() - valB < 10 )
- historieF->setPosition( 10, historieF->getY() );
- else
- historieF->setPosition( historieF->getX() - valB, historieF->getY() );
- statistik->setPosition( historieF->getX(), historieF->getY() );
- rend = 1;
- }
- }
- }
- else
- {
- if( ( animation | 0x2 ) == animation )
- {
- if( historieF->getX() != 810 )
- {
- if( historieF->getX() + valB > 810 )
- historieF->setPosition( 810, historieF->getY() );
- else
- historieF->setPosition( historieF->getX() + valB, historieF->getY() );
- statistik->setPosition( historieF->getX(), historieF->getY() );
- rend = 1;
- }
- }
- else
- {
- if( historieF->getX() != -810 )
- {
- if( historieF->getX() - valB < -810 )
- historieF->setPosition( -810, historieF->getY() );
- else
- historieF->setPosition( historieF->getX() - valB, historieF->getY() );
- statistik->setPosition( historieF->getX(), historieF->getY() );
- rend = 1;
- }
- }
- }
- }
- if( !alpha2 && !statistik->istNochSichtbar() )
- {
- animation &= ~0x8;
- statistik->reset();
- }
- if( !alpha3 && !video->istNochSichtbar() )
- {
- animation &= ~0x10;
- video->reset();
- }
- bool ret = rend;
- rend = 0;
- return ret;
- }
- void AccountHistorie::doMausEreignis( MausEreignis &me )
- {
- if( !statistik->istNochSichtbar() && !video->istNochSichtbar() && alpha == 255 && alpha2 == 255 && alpha3 == 255 )
- {
- int sortSpalteS = sortSpalte->getAuswahl();
- int sortRichtungS = sortRichtung->getAuswahl();
- historieF->doMausEreignis( me );
- if( sortSpalte->getAuswahl() != sortSpalteS )
- {
- liste->setSortSpalte( sortSpalte->zEintrag( sortSpalte->getAuswahl() )->zText()->getText() );
- sortSpalte->einklappen();
- }
- if( sortRichtung->getAuswahl() != sortRichtungS )
- {
- liste->setSortRichtung( sortRichtung->getAuswahl() != 0 );
- sortRichtung->einklappen();
- }
- int spielId = 0;
- int karteId = 0;
- int ak = liste->getAktion( &spielId, &karteId );
- if( ak == 1 )
- {
- if( statistik->ladeDaten( spielId, karteId ) )
- animation |= 0x8;
- }
- if( ak == 2 )
- {
- if( video->ladeDaten( spielId, karteId ) )
- animation |= 0x10;
- }
- }
- if( statistik->istNochSichtbar() )
- statistik->doMausEreignis( me );
- }
- void AccountHistorie::doTastaturEreignis( TastaturEreignis &te )
- {
- if( statistik->istNochSichtbar() )
- statistik->doTastaturEreignis( te );
- }
- void AccountHistorie::render( Bild &zRObj )
- {
- zRObj.setAlpha( alpha );
- if( alpha2 && alpha3 )
- {
- zRObj.setAlpha( alpha2 );
- zRObj.setAlpha( alpha3 );
- historieF->render( zRObj );
- zRObj.releaseAlpha();
- zRObj.releaseAlpha();
- }
- if( statistik->istNochSichtbar() )
- statistik->render( zRObj );
- if( video->istNochSichtbar() )
- video->render( zRObj );
- zRObj.releaseAlpha();
- }
- int AccountHistorie::getStatus() const
- {
- return status;
- }
- AccountHistorie *AccountHistorie::getThis()
- {
- ref++;
- return this;
- }
- AccountHistorie *AccountHistorie::release()
- {
- ref--;
- if( !ref )
- delete this;
- return 0;
- }
|