-
Notifications
You must be signed in to change notification settings - Fork 0
/
filereader.h
54 lines (46 loc) · 1.24 KB
/
filereader.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef FILEREADER_H
#define FILEREADER_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "list.h"
#include "types.h"
#include "defaults.h"
#define MAP 0
#define TARGET_SCORE 1
#define INITIAL_SPEED 2
#define INITIAL_DIRECTION 3
#define SPAWN_POINT 4
#define SPAWN_DATA 5
#define TUNNEL_DATA 6
#define NOT_LEVEL_TAG -1
#define BRARITY 0
#define BFREQUENCY 4
#define BGENEROSITY 8
#define BITEMS_AT_ONCE 12
#define BEXPIRING_IN 14
#define BMAX_ITEMS_AT_ONCE 16
#define BWHAT_CAN_BE_SPAWNED 20
#define BBONUS 24
#define BTYPE 28
#define BDURATION 32
#define NOT_BONUS_TAG -1
#define TUNNEL_TAG 0
#define TUNNEL_WAY1 1
#define TUNNEL_WAY2 2
#define NOT_TUNNEL_TAG -1
int readWord(char* str, char* buffer, int start);
int readLine(FILE* in, char* buffer, size_t max);
void clearBuffer(char* buff, int size);
int toConstant(char* constString);
int getTag(char* tag);
int getBonusRelatedTag(char* tag);
int getTunnelRelatedTag(char* tag);
void getMap(FILE* in, Level* l);
void getSpawnData(FILE* in, Level* l);
void getTunnelData(FILE* in, Level* l);
void getWhatCanBeSpawned(FILE* in, SpawnData* sd);
Level* loadLevelFromFile(Snake* s, const char* fileName);
Bonus* newDefaultBonus();
SpawnData newDefaultSpawnData();
#endif /* FILEREADER_H */