a4
This commit is contained in:
		
							parent
							
								
									03cb0c7ea2
								
							
						
					
					
						commit
						36ee603067
					
				
							
								
								
									
										38
									
								
								a4/world.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								a4/world.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,38 @@
 | 
				
			|||||||
 | 
					#ifndef _WORLD_H_
 | 
				
			||||||
 | 
					#define _WORLD_H_
 | 
				
			||||||
 | 
					#define COLOR_COUNT 8
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <curses.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					enum event_type {
 | 
				
			||||||
 | 
					    EVENT_START,
 | 
				
			||||||
 | 
					    EVENT_TIMEOUT,
 | 
				
			||||||
 | 
					    EVENT_KEY,
 | 
				
			||||||
 | 
					    EVENT_MOUSE,
 | 
				
			||||||
 | 
					    EVENT_RESIZE,
 | 
				
			||||||
 | 
					    EVENT_ESC,
 | 
				
			||||||
 | 
					    EVENT_END,
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					struct event {
 | 
				
			||||||
 | 
					    int width;
 | 
				
			||||||
 | 
					    int height;
 | 
				
			||||||
 | 
					    int key;
 | 
				
			||||||
 | 
					    int alt_key;
 | 
				
			||||||
 | 
					    enum event_type type;
 | 
				
			||||||
 | 
					    int mouse_x;
 | 
				
			||||||
 | 
					    int mouse_y;
 | 
				
			||||||
 | 
					    int mouse_left;
 | 
				
			||||||
 | 
					    int mouse_right;
 | 
				
			||||||
 | 
					    int mouse_middle;
 | 
				
			||||||
 | 
					    long int time_ms;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void set_cell(int character, int x, int y);
 | 
				
			||||||
 | 
					void set_color_cell(int character, int x, int y, short front_color, short back_color);
 | 
				
			||||||
 | 
					int start_world(void* (*init_game)(), int (*world_event)(struct event*, void*), void (*destroy_game)(void*));
 | 
				
			||||||
 | 
					void game_speed(int value);
 | 
				
			||||||
 | 
					void set_message(const char* message, int x, int y);
 | 
				
			||||||
 | 
					void clear_screen();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user