Browse Source

v1.1.7 moved board info to board.h

Aaro Saila 1 year ago
parent
commit
fcbeb38ea5
6 changed files with 15 additions and 24 deletions
  1. 1 3
      src/board/board.c
  2. 11 1
      src/board/board.h
  3. 0 16
      src/globals.h
  4. 1 2
      src/main.c
  5. 1 1
      src/snake/snake.h
  6. 1 1
      src/utils/utils.h

+ 1 - 3
src/board/board.c

@@ -1,8 +1,6 @@
 #include <stdio.h>
 
-#include "../globals.h"
-
-extern boardInfo brdInfo;
+#include "board.h"
 
 void setBoardBorders(char board[][brdInfo.x]) {
   for (int i = 0; i < brdInfo.y; i++) {

+ 11 - 1
src/board/board.h

@@ -1,7 +1,17 @@
 #ifndef BOARD_H_
 #define BOARD_H_
 
-#include "../globals.h"
+typedef struct {
+  int x;
+  int y;
+} boardInfo;
+
+typedef struct {
+  int xs;
+  int xe;
+  int ys;
+  int ye;
+} playableBoardInfo;
 
 extern boardInfo brdInfo;
 

+ 0 - 16
src/globals.h

@@ -1,16 +0,0 @@
-#ifndef GLOBALS_H_
-#define GLOBALS_H_
-
-typedef struct {
-  int x;
-  int y;
-} boardInfo;
-
-typedef struct {
-  int xs;
-  int xe;
-  int ys;
-  int ye;
-} playableBoardInfo;
-
-#endif  // GLOBALS_H_

+ 1 - 2
src/main.c

@@ -10,9 +10,8 @@
 #include "./utils/utils.h"
 #include "./snake/snake.h"
 #include "./board/board.h"
-#include "globals.h"
 
-const char* VERSION = "1.1.6";
+const char* VERSION = "1.1.7";
 
 const char SNAKE_VIS = '#';
 

+ 1 - 1
src/snake/snake.h

@@ -1,7 +1,7 @@
 #ifndef SNAKE_H_
 #define SNAKE_H_
 
-#include "../globals.h"
+#include "../board/board.h"
 
 extern boardInfo brdInfo;
 

+ 1 - 1
src/utils/utils.h

@@ -3,7 +3,7 @@
 
 #include <time.h>
 
-#include "../globals.h"
+#include "../board/board.h"
 
 extern boardInfo brdInfo;