Beispiel #1
0
        public void HangarStackRemove()
        {
            Hangar h = new Hangar(station, corporation);

            ResourceElement elem1  = new ResourceElement(ResourceElement.ResourceType.Wastes, station, 100, 1);
            ResourceStack   stack1 = new ResourceStack(elem1);

            bool eventTrigered = false;

            h.Add(stack1);
            h.onRemoveStack += (s) => { eventTrigered = true; };
            h.GetStack(ResourceElement.ResourceType.Wastes, 100);

            Assert.IsTrue(eventTrigered);
            Assert.AreEqual(0, h.ResourceStacks.Count);
        }
Beispiel #2
0
        public void HangarRemoveResources()
        {
            Hangar h = new Hangar(station, corporation);

            ResourceElement elem1  = new ResourceElement(ResourceElement.ResourceType.Wastes, station, 100, 1);
            ResourceStack   stack1 = new ResourceStack(elem1);

            h.Add(stack1);

            ResourceElement elem2  = new ResourceElement(ResourceElement.ResourceType.Wastes, station, 100, 2);
            ResourceElement elem3  = new ResourceElement(ResourceElement.ResourceType.Wastes, station, 100, 3);
            ResourceStack   stack2 = new ResourceStack(elem2);

            stack2.Add(elem3);
            h.Add(stack2);

            ResourceStack outStack = h.GetStack(ResourceElement.ResourceType.Wastes, 50);

            Assert.NotNull(outStack);
            Assert.AreEqual(50, outStack.Qte);
            Assert.AreEqual(ResourceElement.ResourceType.Wastes, outStack.Type);
            Assert.AreEqual(250, h.GetResourceQte(ResourceElement.ResourceType.Wastes));
        }