public bool Check(Location location)
		{
			if (location != _currentLocation)
			{
				return false;
			}
			else
			{
				return true;
			}
		}
		public void Move()
		{
			bool hidden = false;
			while (!hidden)
			{
				if (_currentLocation is IHaveExteriorDoor)
				{
					if (_random.Next(2) == 1)
					{
						_currentLocation = ((IHaveExteriorDoor)_currentLocation).DoorLocation;
					}


				}
				_currentLocation = _currentLocation.Exits[_random.Next(_currentLocation.Exits.Length)];
				if (_currentLocation is IHidingPlace)
				{
					hidden = true;
				}
			}
		}
		public Opponent(Location location)
		{
			_currentLocation = location;
			_random = new Random();
		}
Beispiel #4
0
		internal void MoveToANewLocation(Location newLocation)
		{
			Moves++;
			_currentLocation = newLocation;
			RedrawForm();
		}