Exemple #1
0
 private void WriteTypeDescription(BinaryWriter writer, PofTypeDescription desc)
 {
     foreach (var type in desc.All())
     {
         writer.Write((int)context.GetTypeIdByType(type));
     }
 }
Exemple #2
0
 private Type CreateTypeFromDescription(PofTypeDescription desc)
 {
     if (!desc.HasGenericDefinition)
     {
         return(desc.First());
     }
     else
     {
         return(desc.First().MakeGenericType(desc.AfterFirst()));
     }
 }
 private Type CreateTypeFromDescription(PofTypeDescription desc)
 {
     if (!desc.HasGenericDefinition)
     {
         return(desc.First());
     }
     else
     {
         var genericArguments = desc.AfterFirst();
         if (genericArguments.All(x => x == typeof(void)))
         {
             return(desc.First());
         }
         else
         {
             return(desc.First().MakeGenericType(genericArguments));
         }
     }
 }
Exemple #4
0
 public Type GetTypeFromDescription(PofTypeDescription typeDescription)
 {
     return(typeByDescription.GetOrAdd(typeDescription, CreateTypeFromDescription));
 }