Exemplo n.º 1
0
        public T CreateGroup <T>() where T : GroupComponent
        {
            T component = GroupRegistry.FindOrCreateGroup <T>(this.Id);

            this.AddComponent(component);
            return(component);
        }
Exemplo n.º 2
0
        public override object Decode(ProtocolBuffer protocolBuffer)
        {
            long uid       = (long)this.longCodec.Decode(protocolBuffer);
            Type typeByUid = this.protocol.GetTypeByUid(uid);

            return(GroupRegistry.FindOrCreateGroup(typeByUid, (long)this.longCodec.Decode(protocolBuffer)));
        }
Exemplo n.º 3
0
 public void AddComponent(Component component)
 {
     if (component is GroupComponent)
     {
         component = GroupRegistry.FindOrRegisterGroup((GroupComponent)component);
     }
     this.AddComponent(component, true);
 }
Exemplo n.º 4
0
 public MethodTransform(NamingRulesManager namingRules,
                        GroupRegistry groupRegistry,
                        MarshalledElementFactory factory,
                        IInteropSignatureTransform interopSignatureTransform,
                        Ioc ioc) : base(namingRules, ioc)
 {
     this.groupRegistry = groupRegistry;
     this.factory       = factory;
     signatureTransform = interopSignatureTransform;
 }
 private void AutoAddComponents(EntityInternal newEntity, TemplateDescription templateDescription)
 {
     foreach (Type type in templateDescription.GetAutoAddedComponentTypes())
     {
         Component component = !typeof(GroupComponent).IsAssignableFrom(type) ? newEntity.CreateNewComponentInstance(type) : GroupRegistry.FindOrCreateGroup(type, newEntity.Id);
         newEntity.AddComponent(component);
     }
 }
Exemplo n.º 6
0
        private void AddJoinComponent <T>(Platform.Kernel.ECS.ClientEntitySystem.API.Entity key) where T : GroupComponent
        {
            GroupComponent component = GroupRegistry.FindOrCreateGroup <T>(key.Id);

            this.Entity.AddComponent(component);
        }