Skip to content
This repository has been archived by the owner on Oct 15, 2021. It is now read-only.

add FGeographicCoordinates::operator==, != #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ struct FGeographicCoordinates
* @return Reference to vector after copy.
*/
FORCEINLINE FGeographicCoordinates& operator=(const FGeographicCoordinates& Other);

/**
* Compare another FGeographicCoordinates into this one
*
* @param Other The coordinate to compare with.
* @return true if the coordinates are equal, false otherwise.
*/
FORCEINLINE bool operator==(const FGeographicCoordinates& Other) const;

/**
* Copy another FVector into this one
*
* @param Other The coordinate to compare with.
* @return true if the coordinates are not equal, false otherwise.
*/
FORCEINLINE bool operator!=(const FGeographicCoordinates& Other) const;
#endif

};
Expand Down Expand Up @@ -79,4 +95,16 @@ FORCEINLINE FGeographicCoordinates& FGeographicCoordinates::operator=(const FGeo
return *this;
}

FORCEINLINE bool operator==(const FGeographicCoordinates& Other) const
{
return (this->Latitude == Other.Latitude) &&
(this->Longitude == Other.Longitude) &&
(this->Altitude == Other.Altitude);
}

FORCEINLINE bool operator!=(const FGeographicCoordinates& Other) const
{
return !(*this==Other);
}

#endif