Ejemplo n.º 1
0
        public static bool ReflectionUnitTest()
        {
            try
            {
                Type type = InternalType;
                if (type == null)
                {
                    throw new Exception("Could not find internal type for SectorObjectManager");
                }
                bool result = true;
                result &= BaseObject.HasMethod(type, ObjectManagerGetEntityHashSet);
                result &= BaseObject.HasMethod(type, ObjectManagerAddEntity);

                Type type2 = SandboxGameAssemblyWrapper.Instance.GetAssemblyType(ObjectFactoryNamespace, ObjectFactoryClass);
                if (type2 == null)
                {
                    throw new Exception("Could not find object factory type for SectorObjectManager");
                }

                Type type3 = SandboxGameAssemblyWrapper.Instance.GetAssemblyType(EntityBaseNetManagerNamespace, EntityBaseNetManagerClass);
                if (type3 == null)
                {
                    throw new Exception("Could not find entity base network manager type for SectorObjectManager");
                }
                result &= BaseObject.HasMethod(type3, EntityBaseNetManagerSendEntity);

                return(result);
            }
            catch (Exception ex)
            {
                LogManager.APILog.WriteLine(ex);
                return(false);
            }
        }
Ejemplo n.º 2
0
        public static bool ReflectionUnitTest( )
        {
            try
            {
                Type type1 = SandboxGameAssemblyWrapper.Instance.GetAssemblyType(PowerReceiverNamespace, PowerReceiverClass);
                if (type1 == null)
                {
                    throw new Exception("Could not find internal type for PowerReceiver");
                }
                bool result = true;
                result &= BaseObject.HasMethod(type1, PowerReceiverRunPowerRateCallbackMethod);
                result &= BaseObject.HasMethod(type1, PowerReceiverGetCurrentInputMethod);
                result &= BaseObject.HasMethod(type1, PowerReceiverGetCurrentRateMethod);
                result &= BaseObject.HasMethod(type1, PowerReceiverSetMaxRequiredInputMethod);
                result &= BaseObject.HasField(type1, PowerReceiverMaxRequiredInputField);
                result &= BaseObject.HasField(type1, PowerReceiverPowerRatioField);
                result &= BaseObject.HasField(type1, PowerReceiverInputRateCallbackField);

                return(result);
            }
            catch (Exception ex)
            {
                LogManager.ErrorLog.WriteLine(ex);
                return(false);
            }
        }
Ejemplo n.º 3
0
        new public static bool ReflectionUnitTest()
        {
            try
            {
                Type type = InternalType;
                if (type == null)
                {
                    throw new Exception("Could not find internal type for InventoryEntity");
                }
                bool result = true;
                result &= BaseObject.HasMethod(type, InventoryCalculateMassVolumeMethod);
                result &= BaseObject.HasMethod(type, InventoryGetTotalVolumeMethod);
                result &= BaseObject.HasMethod(type, InventoryGetTotalMassMethod);
                result &= BaseObject.HasMethod(type, InventorySetFromObjectBuilderMethod);
                result &= BaseObject.HasMethod(type, InventoryGetObjectBuilderMethod);
                result &= BaseObject.HasMethod(type, InventoryCleanUpMethod);
                result &= BaseObject.HasMethod(type, InventoryGetItemListMethod);
                result &= BaseObject.HasMethod(type, InventoryAddItemAmountMethod);

                Type[] argTypes = new Type[3];
                argTypes[0] = typeof(MyFixedPoint);
                argTypes[1] = typeof(MyObjectBuilder_PhysicalObject);
                argTypes[2] = typeof(bool);
                result     &= BaseObject.HasMethod(type, InventoryRemoveItemAmountMethod, argTypes);

                return(result);
            }
            catch (Exception ex)
            {
                LogManager.APILog.WriteLine(ex);
                return(false);
            }
        }
Ejemplo n.º 4
0
        public static bool ReflectionUnitTest( )
        {
            try
            {
                Type type = InternalType;
                if (type == null)
                {
                    throw new Exception("Could not find internal type for BaseEntityNetworkManager");
                }
                bool result = BaseObject.HasMethod(type, BaseEntityBroadcastRemovalMethod);

                return(result);
            }
            catch (Exception ex)
            {
                ApplicationLog.BaseLog.Error(ex);
                return(false);
            }
        }
        public static bool ReflectionUnitTest()
        {
            try
            {
                Type type = InternalType;
                if (type == null)
                {
                    throw new Exception("Could not find internal type for InventoryItemEntity");
                }
                bool result = true;
                result &= BaseObject.HasMethod(type, InventoryItemGetObjectBuilderMethod);

                return(result);
            }
            catch (Exception ex)
            {
                LogManager.APILog.WriteLine(ex);
                return(false);
            }
        }
Ejemplo n.º 6
0
        public static bool ReflectionUnitTest()
        {
            try
            {
                Type type1 = SandboxGameAssemblyWrapper.Instance.GetAssemblyType(PowerProducerNamespace, PowerProducerClass);
                if (type1 == null)
                {
                    throw new Exception("Could not find internal type for PowerProducer");
                }
                bool result = true;
                result &= BaseObject.HasMethod(type1, PowerProducerGetMaxPowerOutputMethod);
                result &= BaseObject.HasMethod(type1, PowerProducerGetCurrentOutputMethod);
                result &= BaseObject.HasMethod(type1, PowerProducerSetCurrentOutputMethod);

                return(result);
            }
            catch (Exception ex)
            {
                LogManager.ErrorLog.WriteLine(ex);
                return(false);
            }
        }