static MyObjectBuilderSerializer()
 {
     Serializer = TypeModel.Create();
     Serializer.AutoAddMissingTypes     = true;
     Serializer.UseImplicitZeroDefaults = false;
     m_objectFactory = new MyObjectFactory <MyObjectBuilderDefinitionAttribute, MyObjectBuilder_Base>();
 }
        public static void UnregisterAssembliesAndSerializers()
        {
            m_objectFactory = new MyObjectFactory <MyObjectBuilderDefinitionAttribute, MyObjectBuilder_Base>();
#if !XB1                                     // XB1_NOPROTOBUF
            Serializer = TypeModel.Create(); // create empty protobuf serializer
            Serializer.AutoAddMissingTypes     = true;
            Serializer.UseImplicitZeroDefaults = false;
#endif // !XB1
        }
        static MyObjectBuilderSerializer()
        {
#if !XB1 // XB1_NOPROTOBUF
            Serializer = TypeModel.Create();
            Serializer.AutoAddMissingTypes     = true;
            Serializer.UseImplicitZeroDefaults = false;
#endif // !XB1
            m_objectFactory = new MyObjectFactory <MyObjectBuilderDefinitionAttribute, MyObjectBuilder_Base>();
        }
 public static void UnregisterAssembliesAndSerializers()
 {
     m_objectFactory = new MyObjectFactory <MyObjectBuilderDefinitionAttribute, MyObjectBuilder_Base>();
     // -------------------------
     m_serializersByType.Clear();
     m_serializersBySerializedName.Clear();
     m_serializedNameByType.Clear();
     // -------------------------
     Serializer = TypeModel.Create(); // create empty protobuf serializer
     Serializer.AutoAddMissingTypes     = true;
     Serializer.UseImplicitZeroDefaults = false;
 }
Beispiel #5
0
        static MyObjectBuilderSerializer()
        {
            Serializer = TypeModel.Create();
            Serializer.AutoAddMissingTypes     = true;
            Serializer.UseImplicitZeroDefaults = false;

            m_objectFactory = new MyObjectFactory <MyObjectBuilderDefinitionAttribute, MyObjectBuilder_Base>();

            m_objectFactory.RegisterFromAssembly(Assembly.GetExecutingAssembly());
            m_objectFactory.RegisterFromAssembly(MyPlugins.SandboxAssembly); //TODO: Will be removed
            m_objectFactory.RegisterFromAssembly(MyPlugins.GameAssembly);
            m_objectFactory.RegisterFromAssembly(MyPlugins.UserAssembly);

            LoadSerializers();
        }