Exemple #1
0
	/// <summary>
	/// Removes the character in this position.
	/// </summary>
	/// <returns>The character that was in this position.</returns>
	public LocationPiece RemoveCharacter(LocationPiece characterToCheck)
	{
		if (_currentOccupant.Equals(characterToCheck))
			return RemoveCharacter();

		return null;
	}
Exemple #2
0
	/// <summary>
	/// Places the character piece into this position, if available.
	/// </summary>
	/// <returns><c>true</c>, if character was placed, <c>false</c> otherwise.</returns>
	/// <param name="character">Character to place into this position.</param>
	public bool AddCharacter(LocationPiece character)
	{
		if (IsOccupied)
			return false;

		_currentOccupant = character;
		return true;
	}
Exemple #3
0
	/// <summary>
	/// Removes the character in this position.
	/// </summary>
	/// <returns>The character that was in this position.</returns>
	public LocationPiece RemoveCharacter()
	{
		if (!IsOccupied)
			return null;

		var temp = _currentOccupant;
		_currentOccupant = null;
		return temp;
	}
Exemple #4
0
    /// <summary>
    /// Removes the character in this position.
    /// </summary>
    /// <returns>The character that was in this position.</returns>
    public LocationPiece RemoveCharacter(LocationPiece characterToCheck)
    {
        if (_currentOccupant.Equals(characterToCheck))
        {
            return(RemoveCharacter());
        }

        return(null);
    }
Exemple #5
0
    /// <summary>
    /// Places the character piece into this position, if available.
    /// </summary>
    /// <returns><c>true</c>, if character was placed, <c>false</c> otherwise.</returns>
    /// <param name="character">Character to place into this position.</param>
    public bool AddCharacter(LocationPiece character)
    {
        if (IsOccupied)
        {
            return(false);
        }

        _currentOccupant = character;
        return(true);
    }
Exemple #6
0
    /// <summary>
    /// Removes the character in this position.
    /// </summary>
    /// <returns>The character that was in this position.</returns>
    public LocationPiece RemoveCharacter()
    {
        if (!IsOccupied)
        {
            return(null);
        }

        var temp = _currentOccupant;

        _currentOccupant = null;
        return(temp);
    }