Exemplo n.º 1
0
 private void Handle(ComponentAddedMessage msg)
 {
     if (msg.Component is UpdateableComponent updateableComponent)
     {
         Add(updateableComponent);
     }
 }
Exemplo n.º 2
0
 private void Handle(ComponentAddedMessage msg)
 {
     if (msg.Component is TileMapComponent tileMapComponent)
     {
         _tileMap = tileMapComponent.TileMap;
     }
 }
Exemplo n.º 3
0
 private void Handle(ComponentAddedMessage componentAddedMessage)
 {
     if (componentAddedMessage.Component is RenderableComponent renderableComponent)
     {
         Add(renderableComponent);
     }
 }
            public void SetUp()
            {
                _componentRegistration = RegistrationBuilder
                                         .ForType(typeof(string))
                                         .CreateRegistration();

                _fixture = new ModuleTestHarness();

                _fixture.ClearMessages();
                _fixture.Container.ComponentRegistry.Register(_componentRegistration);

                _message = _fixture.GetSingleMessageOrDefault <ComponentAddedMessage>();
            }
        protected override void AttachToComponentRegistration(IComponentRegistry componentRegistry, IComponentRegistration registration)
        {
            base.AttachToComponentRegistration(componentRegistry, registration);

            var includedTypes = ModelMapper.GetReferencedTypes(registration);

            foreach (var includedType in includedTypes)
            {
                SendTypeModelIfNeeded(includedType);
            }
            var message = new ComponentAddedMessage(ModelMapper.GetComponentModel(registration));

            Send(message);
        }