コード例 #1
0
ファイル: AuxerTestingZone.cs プロジェクト: JonECG/Brogue
        public void testTwoLinkSwitchToInteractable()
        {
            bool passed = false;

            targetObject = new Door();
            lever = new Switch(targetObject);

            if (lever.target != null)
            {
                passed = true;
            }

            if (!passed)
            {
                throw new System.ArgumentException("Switch did not link to object", "testTwoLinkSwitchToInteractable");
            }
        }
コード例 #2
0
ファイル: AuxerTestingZone.cs プロジェクト: JonECG/Brogue
        public void testThreeActOnSwichToObject()
        {
            bool passed = false;
            bob = new Mage();
            targetObject = new Door(Direction.UP);
            lever = new Switch(targetObject);

            Direction first = targetObject.directionFacing;
            lever.actOn(bob);
            Direction second = targetObject.directionFacing;

            if (first != second)
            {
                passed = true;
            }

            if (!passed)
            {
                throw new System.ArgumentException("Switch acting on object", "testThreeActOnSwichToObject");
            }
        }