Exemple #1
0
        public void UsesComponentPoolWhenCopyingComponents()
        {
            _originalEntity.AddComponentA();

            var component = new ComponentA();

            _targetEntity.GetComponentPool(MyTestComponentsLookup.ComponentA).Push(component);
            _originalEntity.CopyTo(_targetEntity);

            Assert.AreEqual(component, _targetEntity.GetComponentA());
        }
        public void UsesComponentPoolWhenCopyingComponents()
        {
            _entity.AddComponentA();

            var component = new ComponentA();

            _target.GetComponentPool(CID.ComponentA).Push(component);

#pragma warning disable CS0618  // Type or member is obsolete
#pragma warning disable HAA0101 // Array allocation for params parameter
            _entity.CopyTo(_target);
#pragma warning restore HAA0101 // Array allocation for params parameter
#pragma warning restore CS0618  // Type or member is obsolete

            Assert.AreEqual(component, _target.GetComponentA());
        }
Exemple #3
0
        public void ComponentPoolCanBeRetrieved()
        {
            var componentPool = _defaultEntity.GetComponentPool(MyTestComponentsLookup.ComponentA);

            Assert.AreEqual(0, componentPool.Count);
        }