Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
C-/C++-Quelltext |
|
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 |
#pragma once #include "stdafx.h" class TFunctor { public: virtual void operator()(float f)=0; virtual void Call(float f)=0; }; template<class TClass> class TSpecificFunctor : public TFunctor { private: void (TClass::*fpt)(float); TClass* pt2Object; public: TSpecificFunctor(TClass* _pt2Object, void(TClass::*_fpt)(float)) {pt2Object = _pt2Object; fpt=_fpt; }; virtual void operator()(float f) { (*pt2Object.*fpt)(f); }; virtual void Call(float f) { (*pt2Object.*fpt)(f); }; }; |
C-/C++-Quelltext |
|
1 |
TSpecificFunctor<MusicTask> m_Fader(this, &MusicTask::Fade); |
C-/C++-Quelltext |
|
1 |
EventManagerTask::GetSingleton().AddEvent(new Event(&m_Fader)); |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 |
void xyz(void) { TSpecificFunctor<MusicTask> m_Fader(this, &MusicTask::Fade); EventManagerTask::GetSingleton().AddEvent(new Event(&m_Fader)); return; } |
Anonymous
unregistriert
Administrator
Zitat von »"unsigned long"«
Fake bitte closen.
Anonymous
unregistriert
Zitat von »"epsilon2"«
ich have eine Functor klasse
Administrator
C-/C++-Quelltext |
|
1 2 3 4 |
void EvemtHandler::AddEvent(APointer<Event> &h) { EventList.pushback(h) } |
Anonymous
unregistriert
zurechtZitat von »"epsilon2"«
an nix da: ignor an wie immer :roll: * mag mich wohl nicht *
Administrator
C-/C++-Quelltext |
|
1 2 3 4 |
Even::Event(Functor *h) { func = h; } |
Werbeanzeige