CubeIndex.Equals C# (CSharp) Method

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool
    public override bool Equals(object obj)
    {
        if(obj == null)
            return false;
        CubeIndex o = (CubeIndex)obj;
        if((System.Object)o == null)
            return false;
        return((x == o.x) && (y == o.y) && (z == o.z));
    }

Usage Example

Ejemplo n.º 1
0
    // Return a List of Locations representing the found path
    public List <CubeIndex> FindPath()
    {
        List <CubeIndex> path    = new List <CubeIndex>();
        CubeIndex        current = goal;

        // path.Add(current);

        while (!current.Equals(start))
        {
            if (!cameFrom.ContainsKey(current))
            {
                MonoBehaviour.print("cameFrom does not contain current.");
                return(new List <CubeIndex>());
            }
            path.Add(current);
            current = cameFrom[current];
        }
        // path.Add(start);
        path.Reverse();
        return(path);
    }
All Usage Examples Of CubeIndex::Equals