using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace WorldStreamer2
{
///
/// Int array comparer.
///
public class IntArrayComparer : IEqualityComparer
{
///
/// Equals the specified x and y.
///
/// The x coordinate.
/// The y coordinate.
public bool Equals(int[] x, int[] y)
{
if (x.Length != y.Length)
{
return false;
}
for (int i = 0; i < x.Length; i++)
{
if (x[i] != y[i])
{
return false;
}
}
return true;
}
///
/// Gets the hash code.
///
/// The hash code.
/// Object.
public int GetHashCode(int[] obj)
{
int result = 17;
for (int i = 0; i < obj.Length; i++)
{
unchecked
{
result = result * 23 + obj[i];
}
}
return result;
}
}
}