public T CreateGroup <T>() where T : GroupComponent { T component = GroupRegistry.FindOrCreateGroup <T>(this.Id); this.AddComponent(component); return(component); }
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))); }
public void AddComponent(Component component) { if (component is GroupComponent) { component = GroupRegistry.FindOrRegisterGroup((GroupComponent)component); } this.AddComponent(component, true); }
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); } }
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); }