#ifndef PINGPONG_PADDLE_H
#define PINGPONG_PADDLE_H

#include <godot_cpp/classes/character_body2d.hpp>

namespace godot {

class PingPongPaddle : public CharacterBody2D {
    GDCLASS(PingPongPaddle, CharacterBody2D)

private:
    float speed = 350.0f;
    bool is_player = true;
    NodePath ball_path;
    float half_height = 60.0f;  // 球拍半高，用于限制移动范围

protected:
    static void _bind_methods();

public:
    PingPongPaddle();
    ~PingPongPaddle();

    void _physics_process(double delta) override;
    void _draw() override;

    // 属性 getter/setter
    void set_speed(float p_speed);
    float get_speed() const;

    void set_is_player(bool p_is_player);
    bool get_is_player() const;

    void set_ball_path(const NodePath &p_path);
    NodePath get_ball_path() const;
};

}

#endif // PINGPONG_PADDLE_H
