ResourceTileLite.Equals C# (CSharp) Method

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool
	public override bool Equals (object obj) {
		ResourceTileLite tile = (ResourceTileLite)obj;
		return (tile.id == this.id);
	}
	public override int GetHashCode () {

Usage Example

Example #1
0
	/// <summary>
	/// Gets the resource tile cache at world position.
	/// </summary>
	/// <returns>
	/// true if able to retrieve a cache at the specified position, otherwise false.
	/// </returns>
	/// <param name='worldPosition'>
	/// World position.
	/// </param>
	/// <param name='tile'>
	/// The cache at the specified position.
	/// </param>
	public static bool GetResourceTileCacheAtWorldPosition(Vector3 position, out ResourceTileLite tile)
	{
		position = use.terrain.transform.InverseTransformPoint(position);
		try {
			tile = use.resourceTileCache[(int)position.z, (int)position.x];
			return (!tile.Equals(ResourceTileLite.Empty()));
		}
		catch (System.IndexOutOfRangeException) {
			tile = ResourceTileLite.Empty();
			return false;
		}
	}