import { AnimationTree, float64 } from 'godot'
import Player from './player'
import PlayerInput from './player_input'
import { onready } from 'godot.annotations'

export default class PlayerAnimation extends AnimationTree {
  private static Interact = 'parameters/conditions/interact'
  private static Movement = 'parameters/Movement/blend_position'

  @onready("../")
  player!: Player
  @onready("../Input")
  player_input!: PlayerInput

  _process(delta: float64): void {
    this.set(PlayerAnimation.Movement, this.player.velocity.length_squared())
  }
}
