Inheritance: MonoBehaviour
    void Awake()
    {
        // Set up the references.
        player = GameObject.FindGameObjectWithTag ("Player").transform;

        nav = GetComponent <NavMeshAgent> ();
        motherShip = GameObject.Find("MotherShip").GetComponent<MotherShip>();
        playerInventory = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerInventory>();
    }
Exemplo n.º 2
0
        public void AsAMotherShipIShouldAbortTheMarsRoverMissionIfThereIsInvalidDirectionForRoverPosition()
        {
            var commands = "1 1\n0 0 A";

            var motherShip = new MotherShip();

            motherShip.ExecuteMarsRoverMission(commands);

            Assert.AreEqual(Messages.RoverArgumentNullExceptionMessage, motherShip.MarsRoverMissionResult);
        }
Exemplo n.º 3
0
        public void AsAMotherShipIShouldAbortTheMarsRoverMissionIfThereIsNegativeYValueForRoverPosition()
        {
            var commands = "1 1\n0 -1 N";

            var motherShip = new MotherShip();

            motherShip.ExecuteMarsRoverMission(commands);

            Assert.AreEqual(Messages.RoverNegativePositionExceptionMessage, motherShip.MarsRoverMissionResult);
        }
Exemplo n.º 4
0
        public void AsAMotherShipIShouldAbortTheMarsRoverMissionIfICannotInitiateTheTerrain()
        {
            var commands = "0 1";

            var motherShip = new MotherShip();

            motherShip.ExecuteMarsRoverMission(commands);

            Assert.AreEqual(Messages.TerrainInvalidInitializationValueExceptionMessage, motherShip.MarsRoverMissionResult);
        }
Exemplo n.º 5
0
        public void AsAMotherShipIShouldReceiveValidTextCommandsAndExecuteTheMarsRoverMission()
        {
            var commands = "5 5\n1 2 N\nLMLMLMLMM\n3 3 E\nMMRMMRMRRM";
            var expectedOutput = "1 3 N\n5 1 E";

            var motherShip = new MotherShip();

            motherShip.ExecuteMarsRoverMission(commands);

            Assert.AreEqual(expectedOutput, motherShip.MarsRoverMissionResult);
        }