2022-08-27 14:03:44 +02:00
|
|
|
#ifndef __LEVEL_H__
|
|
|
|
# define __LEVEL_H__
|
2022-08-20 13:00:23 +02:00
|
|
|
|
2022-08-27 14:03:44 +02:00
|
|
|
#include "settings.h"
|
2022-08-20 13:00:23 +02:00
|
|
|
#include <vector>
|
2022-08-20 15:06:19 +02:00
|
|
|
#include <memory>
|
2022-08-20 13:00:23 +02:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
PLATFORM_EMPTY,
|
|
|
|
PLATFORM_WHITE,
|
|
|
|
PLATFORM_RED,
|
|
|
|
PLATFORM_BLUE,
|
|
|
|
PLATFORM_BLOCK
|
|
|
|
} platform_type_t;
|
|
|
|
|
|
|
|
struct platform {
|
2023-05-24 13:08:59 +02:00
|
|
|
int face;
|
|
|
|
num z;
|
|
|
|
num length;
|
2023-05-24 18:15:39 +02:00
|
|
|
int height;
|
2022-08-20 13:00:23 +02:00
|
|
|
platform_type_t type;
|
|
|
|
};
|
|
|
|
|
2023-05-24 18:15:39 +02:00
|
|
|
struct Generator;
|
2022-08-20 13:00:23 +02:00
|
|
|
|
2023-05-24 13:08:59 +02:00
|
|
|
struct level {
|
|
|
|
std::vector<struct platform> platform_buffer;
|
2023-05-24 18:15:39 +02:00
|
|
|
std::unique_ptr<Generator> gen;
|
2023-06-01 01:23:57 +02:00
|
|
|
uint16_t bgcolor;
|
2023-05-24 13:08:59 +02:00
|
|
|
};
|
2022-08-20 15:06:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-24 13:08:59 +02:00
|
|
|
extern void level_update(struct level *level, num z);
|
|
|
|
extern struct level level_create(int level);
|
2022-08-20 15:06:19 +02:00
|
|
|
|
2022-08-27 14:03:44 +02:00
|
|
|
#endif /* __LEVEL_H__ */
|