mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Weaver.IsArrayType moved to Extensions
This commit is contained in:
parent
b96c92c0de
commit
a0e763bd38
@ -66,5 +66,13 @@ public static bool ImplementsInterface(this TypeDefinition td, TypeReference bas
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsArrayType(this TypeReference tr)
|
||||
{
|
||||
if ((tr.IsArray && ((ArrayType)tr).ElementType.IsArray) || // jagged array
|
||||
(tr.IsArray && ((ArrayType)tr).Rank > 1)) // multidimensional array
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -209,14 +209,6 @@ public static bool CanBeResolved(TypeReference parent)
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool IsArrayType(TypeReference variable)
|
||||
{
|
||||
if ((variable.IsArray && ((ArrayType)variable).ElementType.IsArray) || // jagged array
|
||||
(variable.IsArray && ((ArrayType)variable).Rank > 1)) // multidimensional array
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void DLog(TypeDefinition td, string fmt, params object[] args)
|
||||
{
|
||||
if (!m_DebugFlag)
|
||||
@ -369,7 +361,7 @@ static public void RegisterReadFunc(string name, MethodDefinition newReaderFunc)
|
||||
|
||||
static MethodDefinition GenerateArrayReadFunc(TypeReference variable, MethodReference elementReadFunc)
|
||||
{
|
||||
if (!IsArrayType(variable))
|
||||
if (!variable.IsArrayType())
|
||||
{
|
||||
Log.Error(variable.FullName + " is an unsupported array type. Jagged and multidimensional arrays are not supported");
|
||||
return null;
|
||||
@ -452,7 +444,7 @@ static MethodDefinition GenerateArrayReadFunc(TypeReference variable, MethodRefe
|
||||
|
||||
static MethodDefinition GenerateArrayWriteFunc(TypeReference variable, MethodReference elementWriteFunc)
|
||||
{
|
||||
if (!IsArrayType(variable))
|
||||
if (!variable.IsArrayType())
|
||||
{
|
||||
Log.Error(variable.FullName + " is an unsupported array type. Jagged and multidimensional arrays are not supported");
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user