using Godot;
using System.Collections;
using System.Collections.Generic;
using Godot.Collections;

namespace Rokojori
{
  [Tool]
  [GlobalClass]
  public partial class CharacterControllerAction:Action
  {
    [Export]
    public CharacterController controller;

    public CharacterBody3D body => controller.body;

    public void AddVelocity( Vector3 velocity )
    {
      body.Velocity += velocity * controller.delta;      
    }

    public void SetVelocity( Vector3 velocity )
    {      
      body.Velocity = velocity * controller.delta;
    }

    public void Velocity( Vector3 velocity, bool replace )
    {
      if ( replace )
      {
        SetVelocity( velocity );
      }
      else
      {
        AddVelocity( velocity );
      }
    }



  }

}