Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef ENEMYSTATES_H
- #define ENEMYSTATES_H
- #include "IEnemyState.h"
- #include "IdleState.h"
- class EnemyStates {
- public:
- static IdleState Idle;
- };
- #endif // ENEMYSTATES_H
- ---------------------------
- #ifndef IDLESTATE_H
- #define IDLESTATE_H
- #include "IEnemyState.h"
- class IdleState : public IEnemyState {
- public:
- virtual void apply() {
- printf("idle state. !!!!!!!!!!!!!!\n");
- }
- };
- #endif //IDLESTATE_H
- ------------------------
- #include "Enemy.h"
- #include "StarSystem.h"
- #include "Starship.h"
- #include "EnemyStates.h"
- #include "IdleState.h"
- Enemy::Enemy(StarSystem* starSystem)
- : Boid(starSystem),
- // Some default weights. Eventually we should create a nice factory for this.
- _seperationBehaviour(10), _cohesionBehaviour(15), _alignmentBehaviour(20) {
- // Gives an error:
- EnemyStates::Idle.apply();
- // [more code here.]
- }// [more code here.]
Advertisement
Add Comment
Please, Sign In to add comment