public ClientComponentFactory(IDynamicTypeFactoryInternal typeFactory, IReflectionManager reflectionManager, IConsoleHost conHost)
            : base(typeFactory, reflectionManager, conHost)
        {
            // Required for the engine to work
            RegisterIgnore("KeyBindingInput");

            RegisterClass <MetaDataComponent>();
            RegisterClass <TransformComponent>();
            RegisterClass <MapComponent>();
            RegisterClass <MapGridComponent>();
            RegisterClass <PhysicsComponent>();
            RegisterClass <CollisionWakeComponent>();
            RegisterClass <ClientUserInterfaceComponent>();
            RegisterClass <ContainerManagerComponent>();
            RegisterClass <InputComponent>();
            RegisterClass <SpriteComponent>();
            RegisterClass <ClientOccluderComponent>();
            RegisterClass <OccluderTreeComponent>();
            RegisterClass <EyeComponent>();
            RegisterClass <AppearanceComponent>();
            RegisterClass <AnimationPlayerComponent>();
            RegisterClass <TimerComponent>();

#if DEBUG
            RegisterClass <DebugExceptionOnAddComponent>();
            RegisterClass <DebugExceptionInitializeComponent>();
            RegisterClass <DebugExceptionStartupComponent>();
#endif
        }
Exemple #2
0
        public void ReflectionManager_TestGetAllChildren()
        {
            IReflectionManager reflectionManager = IoCManager.Resolve <IReflectionManager>();

            // I have no idea how to better do this.
            bool did1 = false;
            bool did2 = false;

            foreach (var type in reflectionManager.GetAllChildren <IReflectionManagerTest>())
            {
                if (!did1 && type == typeof(TestClass1))
                {
                    did1 = true;
                }
                else if (!did2 && type == typeof(TestClass2))
                {
                    did2 = true;
                }
                else if (type == typeof(TestClass3))
                {
                    // Not possible since it has [Reflect(false)]
                    Assert.Fail("ReflectionManager returned the [Reflect(false)] class.");
                }
                else if (type == typeof(TestClass4))
                {
                    Assert.Fail("ReflectionManager returned the abstract class");
                }
                else
                {
                    Assert.Fail("ReflectionManager returned too many types.");
                }
            }
            Assert.That(did1 && did2, Is.True, "IoCManager did not return both expected types. First: {0}, Second: {1}", did1, did2);
        }
Exemple #3
0
        public ServerComponentFactory(IDynamicTypeFactoryInternal typeFactory, IReflectionManager reflectionManager, IConsoleHost conHost)
            : base(typeFactory, reflectionManager, conHost)
        {
            RegisterIgnore("Input");
            RegisterIgnore("AnimationPlayer");

            RegisterClass <MetaDataComponent>();
            RegisterClass <TransformComponent>();
            RegisterClass <MapComponent>();
            RegisterClass <MapGridComponent>();
            RegisterClass <EyeComponent>();
            RegisterClass <ActorComponent>();
            RegisterClass <PhysicsComponent>();
            RegisterClass <CollisionWakeComponent>();
            RegisterClass <ContainerManagerComponent>();
            RegisterClass <OccluderComponent>();
            RegisterClass <OccluderTreeComponent>();
            RegisterClass <SpriteComponent>();
            RegisterClass <AppearanceComponent>();
            RegisterClass <SnapGridComponent>();
            RegisterClass <ServerUserInterfaceComponent>();
            RegisterClass <TimerComponent>();
            RegisterClass <MapSaveIdComponent>();

#if DEBUG
            RegisterClass <DebugExceptionOnAddComponent>();
            RegisterClass <DebugExceptionInitializeComponent>();
            RegisterClass <DebugExceptionStartupComponent>();
#endif
        }
Exemple #4
0
        public void ReflectionManager_TestGetType()
        {
            IReflectionManager reflectionManager = IoCManager.Resolve <IReflectionManager>();

            Assert.Multiple(() =>
            {
                Assert.That(reflectionManager.GetType("Shared.Reflection.TestGetType1"), Is.EqualTo(typeof(TestGetType1)));
                Assert.That(reflectionManager.GetType("Shared.Reflection.TestGetType2"), Is.EqualTo(typeof(TestGetType2)));
                Assert.That(reflectionManager.GetType("Shared.Reflection.ITestGetType3"), Is.EqualTo(typeof(ITestGetType3)));
            });
        }
Exemple #5
0
        public WatchWindow()
        {
            _reflectionManager = IoCManager.Resolve <IReflectionManager>();

            ScriptInstanceShared.InitDummy();

            Title = "Watch Window";

            var mainVBox = new BoxContainer
            {
                Orientation = LayoutOrientation.Vertical,
                MinSize     = (500, 300),
                Children    =
                {
                    (_watchesVBox                = new BoxContainer
                    {
                        Orientation              = LayoutOrientation.Vertical,
                        VerticalExpand           = true
                    }),
                    new BoxContainer
                    {
                        Orientation = LayoutOrientation.Horizontal,
                        Children    =
                        {
                            (_addWatchEdit       = new HistoryLineEdit
                            {
                                HorizontalExpand = true,
                                PlaceHolder      = "Add watch (C# interactive)"
                            }),
                            (_addWatchButton     = new Button
                            {
                                Text             = "Add"
                            })
                        }
                    }
                },
            };

            _addWatchButton.OnPressed   += _ => AddWatch();
            _addWatchEdit.OnTextEntered += _ => AddWatch();

            Contents.AddChild(mainVBox);

            SetSize = (300, 300);
        }
        public WatchWindow()
        {
            _reflectionManager = IoCManager.Resolve <IReflectionManager>();

            ScriptInstanceShared.InitDummy();

            Title = Loc.GetString("Watch Window");

            var mainVBox = new VBoxContainer
            {
                CustomMinimumSize = (500, 300),
                Children          =
                {
                    (_watchesVBox                   = new VBoxContainer
                    {
                        SizeFlagsVertical           = SizeFlags.FillExpand
                    }),
                    new HBoxContainer
                    {
                        Children                    =
                        {
                            (_addWatchEdit          = new HistoryLineEdit
                            {
                                SizeFlagsHorizontal = SizeFlags.FillExpand,
                                PlaceHolder         = Loc.GetString("Add watch (C# interactive)")
                            }),
                            (_addWatchButton        = new Button
                            {
                                Text                = Loc.GetString("Add")
                            })
                        }
                    }
                },
            };

            _addWatchButton.OnPressed   += _ => AddWatch();
            _addWatchEdit.OnTextEntered += _ => AddWatch();

            Contents.AddChild(mainVBox);
        }
 public void TestFixtureSetup()
 {
     _reflection = IoCManager.Resolve <IReflectionManager>();
 }
 public ReflectionUpdateEventArgs(IReflectionManager reflectionManager)
 {
     ReflectionManager = reflectionManager;
 }
Exemple #9
0
 public VisualizerTypeSerializer(IReflectionManager reflectionManager)
 {
     _reflectionManager = reflectionManager;
 }
 public BoundKeyMap(IReflectionManager reflectionManager)
 {
     this.reflectionManager = reflectionManager;
 }
 public DynamicEntityMetadataManager(IDynamicEntityMetadataBuilder dynamicEntityMetadataBuilder, IDynamicEntityMetadataValidator[] dynamicEntityMetadataValidators, IReflectionManager reflectionManager)
 {
     _reflectionManager               = reflectionManager;
     _dynamicEntityMetadataBuilder    = dynamicEntityMetadataBuilder;
     _dynamicEntityMetadataValidators = dynamicEntityMetadataValidators;
 }