示例#1
0
        /// <param name="uri">            The uri to identify the component with. </param>
        /// <param name="type">           The type to create the metadata for </param>
        /// <param name="factory">        A reflection library to provide class construction and field get/set functionality </param>
        /// <param name="copyStrategies"> A copy strategy library </param>
        /// <exception cref="NoSuchMethodException"> If the component has no default constructor </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public ComponentMetadata(org.terasology.engine.SimpleUri uri, Class type, org.terasology.reflection.reflect.ReflectFactory factory, org.terasology.reflection.copy.CopyStrategyLibrary copyStrategies) throws NoSuchMethodException
        public ComponentMetadata(SimpleUri uri, Type type, ReflectFactory factory, CopyStrategyLibrary copyStrategies) : base(uri, type, factory, copyStrategies, Predicates.alwaysTrue())
        {
            replicated = type.getAnnotation(typeof(Replicate)) != null;
            blockLifecycleEventsRequired = type.getAnnotation(typeof(RequiresBlockLifecycleEvents)) != null;
            ForceBlockActive forceBlockActiveAnnotation = type.getAnnotation(typeof(ForceBlockActive));

            if (forceBlockActiveAnnotation != null)
            {
                forceBlockActive             = true;
                retainUnalteredOnBlockChange = forceBlockActiveAnnotation.retainUnalteredOnBlockChange();
            }

//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
//ORIGINAL LINE: for (ComponentFieldMetadata<T, ?> field : getFields())
            foreach (ComponentFieldMetadata <T, ?> field in Fields)
            {
                if (field.Replicated)
                {
                    replicated = true;
                    if (field.ReplicationInfo.value().ReplicateFromOwner)
                    {
                        replicatedFromOwner = true;
                    }
                }
                if (field.OwnedReference)
                {
                    referenceOwner = true;
                }
            }
        }
示例#2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public EventMetadata(Class simpleClass, org.terasology.reflection.copy.CopyStrategyLibrary copyStrategies, org.terasology.reflection.reflect.ReflectFactory factory, org.terasology.engine.SimpleUri uri) throws NoSuchMethodException
        public EventMetadata(Type simpleClass, CopyStrategyLibrary copyStrategies, ReflectFactory factory, SimpleUri uri) : base(uri, simpleClass, factory, copyStrategies, Predicates.alwaysTrue())
        {
            if (simpleClass.getAnnotation(typeof(ServerEvent)) != null)
            {
                networkEventType = NetworkEventType.SERVER;
                lagCompensated   = simpleClass.getAnnotation(typeof(ServerEvent)).lagCompensate();
            }
            else if (simpleClass.getAnnotation(typeof(OwnerEvent)) != null)
            {
                networkEventType = NetworkEventType.OWNER;
            }
            else if (simpleClass.getAnnotation(typeof(BroadcastEvent)) != null)
            {
                networkEventType = NetworkEventType.BROADCAST;
                skipInstigator   = simpleClass.getAnnotation(typeof(BroadcastEvent)).skipInstigator();
            }
        }
示例#3
0
 public EventLibrary(ReflectFactory reflectFactory, CopyStrategyLibrary copyStrategies) : base(reflectFactory, copyStrategies)
 {
 }
示例#4
0
 public ComponentLibrary(ReflectFactory factory, CopyStrategyLibrary copyStrategies) : base(factory, copyStrategies)
 {
 }