Changeset 2860 in orxonox.OLD for orxonox/branches/dave/src/command_node.h
- Timestamp:
- Nov 15, 2004, 11:13:21 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/dave/src/command_node.h
r2190 r2860 19 19 //! Key aliasing structure 20 20 /** 21 22 21 This structure contains the key aliasing information, e.g. the command strings that 22 have been bound to the keys. 23 23 */ 24 24 typedef struct 25 25 { 26 27 26 char keys[N_STD_KEYS][CMD_LENGHT]; 27 char buttons[N_BUTTONS][CMD_LENGHT]; 28 28 } KeyBindings; 29 29 30 30 //! Command Node 31 31 /** 32 33 34 35 36 32 This class gathers all incoming SDL_Events and processes them. Keyboard, mouse and joystick input is 33 captured and translated into command messages which are passed down to the bound WorldEntities (via WorldEntity::command()). 34 Other SDL_Events are passed to Orxonox::event_handler() to deal with them. If the CommandNode has been created 35 with bLocalInput set to false, it will query the network class for incoming commands that match his netID and pass 36 them on to it's WorldEntities. 37 37 */ 38 38 class CommandNode { 39 39 private: 40 bool bLocalInput; //!< Identifies the CommandNode that processes local input 41 int netID; //!< Unique identifier that is used to determine between remote CommandNodes 42 KeyBindings* aliases; 43 List<WorldEntity>* bound; //!< List of WorldEntites that recieve commands from this CommandNode 44 Sint32 coord[2]; 45 46 void relay (Command* cmd); 47 int* name_to_index (char* name); 48 void process_local (); 49 void process_network (); 50 void send_over_network (Command* cmd); 51 40 bool bLocalInput; //!< Identifies the CommandNode that processes local input 41 int netID; //!< Unique identifier that is used to determine between remote CommandNodes 42 KeyBindings* aliases; 43 List* bound; //!< List of WorldEntites that recieve commands from this CommandNode 44 Sint32 coord[2]; 45 46 47 void relay (Command* cmd); 48 int* name_to_index (char* name); 49 void process_local (); 50 void process_network (); 51 void send_over_network (Command* cmd); 52 52 53 public: 53 54 CommandNode (int ID); 54 55 CommandNode (char* filename); 55 56 ~CommandNode (); 56 57 58 void reset(); 57 59 void load_bindings (char* filename); 58 60 void bind (WorldEntity* entity);
Note: See TracChangeset
for help on using the changeset viewer.