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)));
        }
 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.º 4
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);
        }