summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/square.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/square.c b/lib/square.c
new file mode 100644
index 0000000..d7b2d59
--- /dev/null
+++ b/lib/square.c
@@ -0,0 +1,21 @@
+#include "square.h"
+
+Color square_get_color(Square s) {
+ return s.color;
+}
+
+Piece* square_get_piece(Square s) {
+ return s.piece;
+}
+
+Square square_set_color(Square s, Color c) {
+ s.color = c;
+
+ return s;
+}
+
+Square square_set_piece(Square s, Piece* p) {
+ s.piece = p;
+
+ return s;
+}
nihil fit ex nihilo