--[[
    Returns true if the current state can transition to specified stateName, otherwise returns false.
]]

function StateHolder:canTransition(stateName)
	if not self._allowedTransitions[stateName] then
		Logger.error("State", stateName, "does not exist!")
		return false
	end

	for _, transitionState in pairs(self._allowedTransitions[self.current]) do
		if transitionState == stateName then
			return true
		end
	end

	return false
end

return StateHolder
