Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ProfileSerializerProcessor.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using SiliconStudio.AssemblyProcessor.Serializers;
4 
5 namespace SiliconStudio.AssemblyProcessor
6 {
7  internal class ProfileSerializerProcessor : ICecilSerializerProcessor
8  {
9  public void ProcessSerializers(CecilSerializerContext context)
10  {
11  var defaultProfile = context.SerializableTypes;
12 
13  foreach (var profile in context.SerializableTypesProfiles)
14  {
15  // Skip default profile
16  if (profile.Value == defaultProfile)
17  continue;
18 
19  // For each profile, try to instantiate all types existing in default profile
20  foreach (var type in defaultProfile.SerializableTypes)
21  {
22  context.GenerateSerializer(type.Key, false, profile.Key);
23  }
24  }
25  }
26  }
27 }
Gives the required generic serializer for a given type. This is useful for generation of serializatio...