-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPuzzleType.cpp
More file actions
36 lines (27 loc) · 818 Bytes
/
PuzzleType.cpp
File metadata and controls
36 lines (27 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// PuzzleType.cpp
// AdvProgEX1
//
// Created by Alexander Shugaley on 09/12/2017.
// Copyright © 2017 Alexander Shugaley. All rights reserved.
//
#include "PuzzleType.h"
bool PuzzleType::operator==(const PuzzleType& otherType) const {
return l == otherType.getLeft()&&
t == otherType.getTop() &&
r == otherType.getRight() &&
b == otherType.getBot();
}
bool PuzzleType::operator<(const PuzzleType& otherType) const{
int otherLeft = otherType.getLeft();
int otherTop = otherType.getTop();
int otherRight = otherType.getRight();
int otherBot = otherType.getBot();
if(l!=otherLeft)
return l<otherLeft;
if(t!=otherTop)
return t<otherTop;
if(r!=otherRight)
return r<otherRight;
return b<otherBot;
}