#ifndef _PLANET_H #define _PLANET_H #include #include "vector.h" #include "list.h" #include "utils.h" struct planet { struct vector speed; struct vector pos; struct list_head list; double mass; float size; unsigned char r, g, b; }; #define list_to_planet(planet) container_of((planet), struct planet, list) void init_planet(const SDL_Surface *screen, struct planet *p); void draw_planet(SDL_Surface *screen, struct planet *p); void gravitize_planets(struct planet *a, struct planet *b, const double time); void move_planet(struct planet *p, const double time); void print_planet(const struct planet *p); #endif