Part of c++ template code from my D3D game engine...
template<class T>
class TState
{
public:
virtual ~TState() {}
virtual void Enter(T*) = 0;
virtual void Execute(T*) = 0;
virtual void Exit(T*) = 0;
virtual bool OnMessage(T*, const tTelegram&) = 0;
};
... and new C# code for my XNA game engine.
public interface TObjectState<T>
{
void Enter(T t);
void Execute(T t);
void Exit(T t);
bool OnMessage(T t, MessageTelegram telegram);
}
Yeah, now I'm very impressed how easy it is and it only took me less a minute to port all my template codes!
So far I'm liking XNA and it's pretty neat if ask me!
Cheers!
No comments:
Post a Comment