Beispiel #1
0
        public void ValuablesContainer_CanPutValuablesInContainer_HasValuable()
        {
            _container.Put(_sampleValuable);

            Assert.AreEqual(1, _container.Valuables.Count());
            Assert.IsTrue(_container.Valuables.Contains(_sampleValuable));
        }
        public void Init()
        {
            _thief = new Thief(this, _map);
            _thief.Subscribe(this);
            var builder = new LayerBuilder(3, 3);

            builder.PutFloor(new XY(0, 0), new XY(2, 2));
            AddPortals(builder);
            _map.Add(_layer = builder.Build());
            _upFacingContainer.Put(_upFacingValuable);
            _rightFacingContainer.Put(_valuable2);
        }
Beispiel #3
0
        public void FacilitySpace_ValuableInContainer_ReturnsCorrectly()
        {
            var space     = new FacilitySpace();
            var container = new ValuablesContainer {
                ObjectLayer = ObjectLayer.LowerObject
            };

            container.Put(new Valuable {
                Type = "Diamond"
            });
            space.Put(container);

            var valuables = space.Valuables.ToList();

            Assert.AreEqual(1, valuables.Count());
            Assert.IsTrue(valuables.Any(x => x.Type.Equals("Diamond")));
        }
        public void FacilityMap_Valuables_AreCorrect()
        {
            _map.Add(_sampleLayer);
            var value1 = new ValuableFacilityObject {
                Type = "Painting", ObjectLayer = ObjectLayer.UpperObject
            };
            var container = new ValuablesContainer {
                Type = "Table", ObjectLayer = ObjectLayer.LowerObject
            };
            var value2 = new Valuable {
                Type = "Diamond"
            };

            container.Put(value2);
            _map[5, 5, 0].Put(value1);
            _map[7, 8, 0].Put(container);

            var valuables = _map.SpatialValuables.ToList();

            Assert.AreEqual(2, valuables.Count);
            Assert.IsTrue(valuables.Any(x => x.Obj.Type.Equals("Painting")));
            Assert.IsTrue(valuables.Any(x => x.Obj.Type.Equals("Diamond")));
        }