local TS = require(
	game:GetService("ReplicatedStorage")
		:WaitForChild("RobloxTS")
		:WaitForChild("Include")
		:WaitForChild("RuntimeLib")
);
local _exports = {};
local Animation;
do
	Animation = {};
	Animation.__index = {
		play = function(self)
			if self.animationTrack then
				self.animationTrack:Play();
			end;
		end;
		stop = function(self)
			if self.animationTrack then
				self.animationTrack:Stop();
			end;
		end;
		isPlaying = function(self)
			if self.animationTrack then
				return self.animationTrack.IsPlaying;
			end;
		end;
	};
	Animation.new = function(...)
		return Animation.constructor(setmetatable({}, Animation), ...);
	end;
	Animation.constructor = function(self, animationId, characterController)
		local humanoid = characterController:getHumanoid();
		if humanoid then
			local animation = Instance.new("Animation");
			animation.AnimationId = "rbxassetid://" .. tostring(animationId);
			self.animationTrack = humanoid:LoadAnimation(animation);
		end;
		return self;
	end;
end;
local AnimationController;
do
	AnimationController = {};
	AnimationController.__index = {
		loadAnimation = function(self, animationId)
			local animation = Animation.new(animationId, self.characterController);
			TS.array_push(self.animations, animation);
			return animation;
		end;
		getAnimatable = function(self)
			return self.animatable;
		end;
		setAnimatable = function(self, animatable)
			self.animatable = animatable;
			TS.array_forEach(self.animations, function(animation)
				local animationTrack = animation.animationTrack;
				if animationTrack then
					if animatable then
						animationTrack:AdjustSpeed(1);
					else
						animationTrack:AdjustSpeed(0);
					end;
				end;
			end);
		end;
	};
	AnimationController.new = function(...)
		return AnimationController.constructor(setmetatable({}, AnimationController), ...);
	end;
	AnimationController.constructor = function(self, characterController)
		self.animatable = true;
		self.characterController = characterController;
		self.animations = {};
		return self;
	end;
end;
_exports.Animation = Animation;
_exports.AnimationController = AnimationController;
return _exports;
