44 lines
857 B
C
44 lines
857 B
C
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include <string.h>
|
|
#include <math.h>
|
|
|
|
#include <raylib.h>
|
|
#include <raymath.h>
|
|
|
|
#include "types.h"
|
|
|
|
#pragma once
|
|
|
|
#define W_ALLOC_BLOCK 256
|
|
#define M_ALLOC_BLOCK 64
|
|
|
|
#define MACH_NULL 0xFFFF
|
|
|
|
#define TPS 20
|
|
|
|
#define TPS_TIME (1.0/TPS)
|
|
|
|
extern MachineDef machine_dict[];
|
|
|
|
int init_game(Game *game);
|
|
|
|
void clean_game(Game *game);
|
|
|
|
Worker *add_worker(Workers *workers, V2d pos);
|
|
|
|
Machine *add_machine(Machines *machines, V2d pos);
|
|
|
|
Machine *get_machine_from_id(Machines *machines, uint16_t id);
|
|
|
|
Worker *get_worker_from_pos(Workers *workers, V2d pos);
|
|
|
|
Machine *get_machine_from_pos(Machines *machines, V2d pos);
|
|
|
|
void update(Game *game);
|
|
|
|
int assign_worker_machine(Machine *machine, Worker *worker);
|
|
|
|
// prends de a et emmène à b
|
|
int assign_worker_fetch(Machine *a, Machine *b, Worker *worker);
|