Exemplo n.º 1
0
        public void ValuableFacilityObject_LinkToOtherValuableFacilityObjectAsFacilityObjects_ValuesAndLevelsMatch()
        {
            var obj1 = new ValuableFacilityObject {
                Name = "One", Value = 900, Publicity = Publicity.Confidential, Liquidity = Liquidity.Low
            };
            var obj2 = new ValuableFacilityObject {
                Name = "Two", Value = 1000, Publicity = Publicity.Obvious, Liquidity = Liquidity.Medium
            };

            ((FacilityObject)obj1).LinkTo((FacilityObject)obj2);

            Assert.AreEqual(obj1.Id, obj2.Id);
            Assert.AreEqual(obj1.Value, obj2.Value);
            Assert.AreEqual(obj1.Publicity, obj2.Publicity);
            Assert.AreEqual(obj1.Liquidity, obj2.Liquidity);
            Assert.AreEqual(obj1.Name, obj2.Name);
        }
Exemplo n.º 2
0
 public void Init()
 {
     _layer               = new FacilityLayer();
     _sampleSpace         = new FacilitySpace();
     _sampleLowerValuable = new ValuableFacilityObject {
         Type = "CouchLeft", ObjectLayer = ObjectLayer.LowerObject
     };
     _sampleLowerValuable2 = new ValuableFacilityObject {
         Type = "CouchRight", ObjectLayer = ObjectLayer.LowerObject
     };
     _sampleUpperValuable = new ValuableFacilityObject {
         Type = "Wallet", ObjectLayer = ObjectLayer.UpperObject
     };
     _sampleGroundPortal = new FacilityPortal {
         Type = "Manhole", ObjectLayer = ObjectLayer.Ground
     };
     _sampleUpperPortal = new FacilityPortal {
         Type = "Door", ObjectLayer = ObjectLayer.UpperObject
     };
 }
        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")));
        }
 public void Notify(ValuableFacilityObject valuable)
 {
     _valuables.Add(valuable);
 }