Gerard-Meier

Untitled

Mar 11th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. class IEnemyState {
  2.     public:
  3.         static void apply() {};// = 0;
  4. };
  5.  
  6. class IdleState : public IEnemyState {
  7.     public:
  8.         static void apply() {
  9.             printf("idle state. !!!!!!!!!!!!!!\n");
  10.         }
  11. };
  12.  
  13. class FooState : public IEnemyState {
  14.     public:
  15.         static void apply() {
  16.             printf("foo state. !!!!!!!!!!!!!!\n");
  17.         }
  18. };
  19.  
  20. class EnemyStates {
  21.     public:
  22.          static IdleState Idle;
  23.          static FooState Foo;
  24. };
  25.  
  26. // Instead of a class, we just stick 'em in a namespace.
  27. namespace Bar {
  28.     IdleState* Idle = new IdleState();
  29.     FooState* Foo = new FooState();
  30. }
Advertisement
Add Comment
Please, Sign In to add comment