Skip to content

Commit e20b625

Browse files
committed
More styleguide conformance
1 parent 9400397 commit e20b625

21 files changed

+593
-610
lines changed

src/Graphics.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ namespace chesspp
44
{
55
namespace graphics
66
{
7-
8-
97
GraphicsHandler::GraphicsHandler( sf::RenderWindow *_display ) : display(_display)
108
{
119
try

src/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ Style Guide & Coding Conventions
88
- Prefer use of `class` to `struct` for declaring classes (this means you need to explicitly specify public inheritance).
99
- Prefer to use file extensions .cpp and .hpp (using .h may cause the file to be detected as C or Objective-C rather than C++)
1010
- Prefer `lowercase` namespace, parameter, and local variable names.
11-
- Prefer `UpperCamelCase` for class names
11+
- Prefer `UpperCamelCase` for class and type names
1212
- Prefer `lowerCamelCase` for member function names
1313
- Prefer `lower_case_underscore` private member names
14+
- Prefer `lwrabbrcase` for namespace names
1415
- Braces should be on their own lines, even for empty definitions
1516
- Namespaces cause indentation to occur, inclusion guards do not
1617
- Avoid using raw pointers when possible

src/board/Bishop.cpp

+16-17
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,25 @@
22

33
namespace chesspp
44
{
5+
Bishop::Bishop(const Position& bPos, Color c)
6+
: Piece(bPos, Position(80 * 3,0), c, Type::BISHOP)
7+
{
58

6-
Bishop::Bishop(const Position& bPos, Color c)
7-
: Piece(bPos, Position(80 * 3,0), c, Type::BISHOP)
8-
{
9+
}
910

10-
}
11+
void Bishop::makeTrajectory(const Board* board)
12+
{
1113

12-
void Bishop::makeTrajectory(const Board* board)
13-
{
14+
Log::Debug::write("BISHOP: ");
15+
Log::Debug::write(this->boardPos);
16+
Log::Debug::writeln("makeTrajectory");
1417

15-
Log::Debug::write("BISHOP: ");
16-
Log::Debug::write(this->boardPos);
17-
Log::Debug::writeln("makeTrajectory");
18+
this->trajectory.clear();
1819

19-
this->trajectory.clear();
20-
21-
// Do the diagonals
22-
shootPath(board, NORTH_EAST);
23-
shootPath(board, SOUTH_EAST);
24-
shootPath(board, SOUTH_WEST);
25-
shootPath(board, NORTH_WEST);
26-
}
20+
// Do the diagonals
21+
shootPath(board, NORTH_EAST);
22+
shootPath(board, SOUTH_EAST);
23+
shootPath(board, SOUTH_WEST);
24+
shootPath(board, NORTH_WEST);
25+
}
2726
}

src/board/Bishop.hpp

+8-9
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@
1010

1111
namespace chesspp
1212
{
13+
class Bishop : public Piece
14+
{
15+
private:
16+
public:
17+
Bishop(const Position& bPos, Color c);
1318

14-
class Bishop : public Piece
15-
{
16-
private:
17-
public:
18-
Bishop(const Position& bPos, Color c);
19-
20-
virtual void makeTrajectory(const Board* board);
21-
};
22-
19+
virtual void makeTrajectory(const Board* board);
20+
};
2321
}
22+
2423
#endif

0 commit comments

Comments
 (0)