コード例 #1
0
        public override IGameComponent AddComponent(int componentId)
        {
            var component = GameCompoentInfo.Allocate(componentId);

            SetComponent(componentId, component);
            return(component);
        }
コード例 #2
0
        public override void RemoveComponent(int componentId)
        {
            var comp = GetComponent(componentId);

            if (comp != null)
            {
                GameCompoentInfo.Free(comp);
                _components.Remove(componentId);
            }
        }
コード例 #3
0
        protected override void OnCleanUp()
        {
            foreach (var component in _components.Values)
            {
                GameCompoentInfo.Free(component.GetComponentId(), component);
            }

            _components.Clear();
            ObjectAllocatorHolder <CompensatioSnapshotGameEntity> .Free(this);
        }
コード例 #4
0
        public override IGameComponent AddComponent(int componentId)
        {
            var component = GameCompoentInfo.Allocate(componentId);

            _list.Add(component);
            var wrapper = ComponentWrapper.Allocate(component);

            _wrapperLists.Add(wrapper);
            _componentListDirty = true;
            return(component);
        }
コード例 #5
0
        public override IGameComponent AddComponent(int componentId, IGameComponent copyValue)
        {
            var component = GameCompoentInfo.Allocate(componentId);

            if (component is ICloneableComponent && copyValue is ICloneableComponent)
            {
                ((ICloneableComponent)component).CopyFrom(copyValue);
            }

            SetComponent(componentId, component);
            return(component);
        }
コード例 #6
0
        public override IGameComponent AddComponent(int componentId, IGameComponent copyValue)
        {
            var component = GameCompoentInfo.Allocate(componentId);

            ((ICloneableComponent)component).CopyFrom(copyValue);

            _list.Add(component);
            var wrapper = ComponentWrapper.Allocate(component);

            _wrapperLists.Add(wrapper);
            _componentListDirty = true;
            return(component);
        }