#pragma once

#include "movementlogic.h"
#include "EnemyCraft.h"
#include <stdlib.h>

class PatternMovement :
    public MovementLogic
{
public:
    PatternMovement(EnemyCraft* host);
    ~PatternMovement(void);
    void InitializeRandomPattern();
    void SetPattern(const int* pattern);
    void Cycle(float deltaMs);
    void Draw();

private:    
    int *m_Pattern;
    int m_PatternIndex;
    int m_IndexSwitchCountdown;     // Countdown in millisekunden, bis der PatternIndex eins weiter geschoben wird
    float m_targetRotZ;

    static const int PATTERN_SIZE;
    static const int PATTERN_FRAME_DURATION_MIN;
    static const int PATTERN_FRAME_DURATION_MAX;
    static const float ROTATION_RANGE_MIN;
    static const float ROTATION_RANGE_MAX;
    void ShiftPatternIndex();
};
