Exemplo n.º 1
0
		public bool Check(Location location)
		{
			if (location != _currentLocation)
			{
				return false;
			}
			else
			{
				return true;
			}
		}
Exemplo n.º 2
0
		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;
				}
			}
		}
Exemplo n.º 3
0
		public Opponent(Location location)
		{
			_currentLocation = location;
			_random = new Random();
		}
Exemplo n.º 4
0
		internal void MoveToANewLocation(Location newLocation)
		{
			Moves++;
			_currentLocation = newLocation;
			RedrawForm();
		}