Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3238 in orxonox.OLD for orxonox/branches/sound/src/command_node.h


Ignore:
Timestamp:
Dec 20, 2004, 2:42:54 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches: updated branches: buerli, nico, sound. And moved bezierTrack to old.bezierTrack. Conflicts resolved in a usefull order.
Conflics mostly resolved in favor of trunk
merge.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/sound/src/command_node.h

    r2190 r3238  
    66*/
    77
    8 #ifndef COMMAND_NODE_H
    9 #define COMMAND_NODE_H
     8#ifndef _COMMAND_NODE_H
     9#define _COMMAND_NODE_H
    1010
    1111#include "stdincl.h"
    1212
    1313class WorldEntity;
     14class World;
    1415
    1516#define N_STD_KEYS SDLK_LAST
     
    1920//! Key aliasing structure
    2021/**
    21         This structure contains the key aliasing information, e.g. the command strings that
    22         have been bound to the keys.
     22   This structure contains the key aliasing information, e.g. the command strings that
     23   have been bound to the keys.
    2324*/
    2425typedef struct
    2526{
    26         char keys[N_STD_KEYS][CMD_LENGHT];
    27         char buttons[N_BUTTONS][CMD_LENGHT];
     27  char keys[N_STD_KEYS][CMD_LENGHT];
     28  char buttons[N_BUTTONS][CMD_LENGHT];
    2829} KeyBindings;
    2930
    3031//! Command Node
    3132/**
    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.
     33   This class gathers all incoming SDL_Events and processes them. Keyboard, mouse and joystick input is
     34   captured and translated into command messages which are passed down to the bound WorldEntities (via WorldEntity::command()).
     35   Other SDL_Events are passed to Orxonox::event_handler() to deal with them. If the CommandNode has been created
     36   with bLocalInput set to false, it will query the network class for incoming commands that match his netID and pass
     37   them on to it's WorldEntities.
    3738*/
    3839class CommandNode {
    3940 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        
     41  bool bLocalInput;     //!< Identifies the CommandNode that processes local input
     42  bool bEnabled;
     43  int netID;    //!< Unique identifier that is used to determine between remote CommandNodes
     44  KeyBindings* aliases;
     45  tList<WorldEntity>* bound;    //!< List of WorldEntites that recieve commands from this CommandNode
     46  Sint32 coord[2];
     47  World* world;
     48 
     49
     50  void relay (Command* cmd);
     51  int* nameToIndex (char* name);
     52  void processLocal ();
     53  void processNetwork ();
     54  void sendOverNetwork (Command* cmd);
     55 
    5256 public:
    5357  CommandNode (int ID);
    5458  CommandNode (char* filename);
    5559  ~CommandNode ();
    56  
    57   void load_bindings (char* filename);
     60
     61  void reset ();
     62  void enable (bool bEnabled);
     63  void loadBindings (char* filename);
    5864  void bind (WorldEntity* entity);
    5965  void unbind (WorldEntity* entity);
     66  void addToWorld (World* world);
    6067  void process ();
    6168 
    62   void set_netID (int ID);
     69  void setNetID (int ID);
    6370};
    6471
    65 #endif
     72#endif /* _COMMAND_NODE_H */
Note: See TracChangeset for help on using the changeset viewer.