using System;
using ACE.Entity.Enum;
using ACE.Server.WorldObjects;
namespace ACE.Server.Entity
{
///
/// Fast chugging state variables
///
public class FoodState
{
///
/// A reference to the Player for this FoodState
///
public Player Player { get; set; }
///
/// This is set to true when a FastTick player is consuming food / drink
/// and allow_fast_chug = true
///
public bool IsChugging { get; set; }
///
/// The eat/drink motion to wait for AnimationDone
///
public MotionCommand UseMotion { get; set; }
///
/// The action to perform when UseMotion has completed
///
public Action Callback { get; set; }
///
/// Similar requirements as previous var
///
public float UseAnimTime { get; set; }
///
/// For returning to combat state after consuming
///
public MotionStance PrevStance { get; set; }
public FoodState(Player player)
{
Player = player;
}
///
/// Called when a player starts performing the motion to apply a consumable
///
public void StartChugging(MotionCommand useMotion, Action callback, float useAnimTime, MotionStance prevStance)
{
IsChugging = true;
UseMotion = useMotion;
Callback = callback;
UseAnimTime = useAnimTime;
PrevStance = prevStance;
}
///
/// Called when a player completes the UseMotion
///
public void FinishChugging()
{
IsChugging = false;
UseMotion = MotionCommand.Invalid;
Callback = null;
UseAnimTime = 0.0f;
PrevStance = MotionStance.Invalid;
}
}
}