Ejemplo n.º 1
0
        public void WithRecorder()
        {
            EntityRecord record = _recorder.Record(_entity);

            record.Set(false);
            record.Set(42);
            record.Remove <bool>();
            record.Remove <int>();
            record.Set(false);
            record.Set(42);
            record.Remove <bool>();
            record.Remove <int>();

            _recorder.Execute(_world);
        }
        public void Remove_Should_remove_component_on_created_entity()
        {
            using EntityCommandRecorder recorder = new(1024);
            using World world = new();

            EntityRecord record = recorder.CreateEntity(world);

            record.Set(true);
            record.Remove <bool>();

            recorder.Execute();

            Check.That(world.Single().Has <bool>()).IsFalse();
        }
        public void Remove_Should_remove_component_on_created_entity()
        {
            using (EntityCommandRecorder recorder = new EntityCommandRecorder(1024))
                using (World world = new World())
                {
                    EntityRecord record = recorder.CreateEntity();
                    record.Set(true);
                    record.Remove <bool>();

                    recorder.Execute(world);

                    Check.That(world.GetAllEntities().Single().Has <bool>()).IsFalse();
                }
        }
        public void Remove_Should_remove_component_on_recorded_entity()
        {
            using (EntityCommandRecorder recorder = new EntityCommandRecorder(1024))
                using (World world = new World())
                {
                    Entity entity = world.CreateEntity();
                    entity.Set(true);

                    EntityRecord record = recorder.Record(entity);
                    record.Remove <bool>();

                    recorder.Execute(world);

                    Check.That(entity.Has <bool>()).IsFalse();
                }
        }