46 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C
		
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C
		
	
	
#ifndef PLAYER_H
 | 
						|
#define PLAYER_H
 | 
						|
#include "tile.h"
 | 
						|
 | 
						|
#define MAX_PLAYER_COMMANDS 128
 | 
						|
/* list of standard command ids */
 | 
						|
#define PLAYER_MOVE 1
 | 
						|
#define PLAYER_ACTIVATE 2
 | 
						|
#define PLAYER_KICK 3
 | 
						|
#define PLAYER_TUMBLE 4
 | 
						|
#define PLAYER_LOOK 5
 | 
						|
 | 
						|
#define TOTAL_RACES 5
 | 
						|
#define RACE_HUMAN 0
 | 
						|
#define RACE_MANITOU 1
 | 
						|
#define RACE_CAPRAN 2
 | 
						|
#define RACE_QUOSQOY 3
 | 
						|
#define RACE_QUOSQO 4
 | 
						|
 | 
						|
#define TOTAL_CLASSES 6
 | 
						|
#define CLASS_WARRIOR 0
 | 
						|
#define CLASS_WIZARD 1
 | 
						|
#define CLASS_PRIEST 2
 | 
						|
#define CLASS_ROGUE 3
 | 
						|
#define CLASS_RANGER 4
 | 
						|
#define CLASS_BARBARIAN 5
 | 
						|
 | 
						|
struct Tile *player;
 | 
						|
 | 
						|
void (*player_commands[128]) (); // pointer to array of command functions
 | 
						|
 | 
						|
/** playerSetCommand
 | 
						|
This function ties a command function to a command id, as contained within the player_commands array. After tying a command to a function, a command can be directly called with the following syntax:
 | 
						|
  (*player_commands[PLAYER_MOVE])(argument_1, argument_2, ...)
 | 
						|
or via the playerCommand helper function:
 | 
						|
  playerCommand(PLAYER_MOVE, argument_1, argument_2, ...)
 | 
						|
**/
 | 
						|
void playerSetCommand(int command_id, void(*function));
 | 
						|
 | 
						|
void playerMove(int direction, int distance);
 | 
						|
void playerLook(int x, int y);
 | 
						|
void playerActivate(int x, int y);
 | 
						|
void playerPickup();
 | 
						|
 | 
						|
#endif
 |