Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6777


Ignore:
Timestamp:
Apr 26, 2010, 2:48:12 PM (15 years ago)
Author:
smerkli
Message:

Brought implementation further, now starting to link into main program.

Location:
code/branches/chat/src/orxonox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/chat/src/orxonox/ChatInputHandler.cc

    r6776 r6777  
    3131namespace orxonox
    3232{
     33  /* singleton */
     34  ManageScopedSingleton( ChatInputHandler, ScopeID::Root, false );
     35
    3336  /* constructor */
    3437  void ChatInputHandler::ChatInputHandler()
    3538  {
     39    /* register the object  */
     40    RegisterObject(ChatInputHandler);
     41
    3642    /* create necessary objects */
    3743    this->inpbuf = new InputBuffer();
     
    6672  }
    6773
     74
     75  /* activate, deactivate */
     76  void ChatInputHandler::activate()   /* TBI */
     77  {
     78    /* start listening */
     79  }
     80
     81  void ChatInputHandler::deactivate()   /* TBI */
     82  {
     83    /* stop listening */
     84  }
     85
     86
     87
    6888  /* callbacks for InputBuffer */
    6989  void ChatInputHandler::inputChanged()
     
    7999    /* actually do send what was input */
    80100    /* a) get the string out of the inputbuffer */
     101    String msgtosend = this->inpbuf->get();
    81102
    82103    /* b) clear the input buffer */
     104    this->inpbuf->clear();
    83105
    84106    /* c) send the chat via some call */
     107    Host::Chat( msgtosend );
    85108
    86109    /* d) stop listening to input  */
  • code/branches/chat/src/orxonox/ChatInputHandler.h

    r6776 r6777  
    4040#include <OrxonoxPrereqs.h>
    4141#include <InputBuffer.h>
     42#include <Host.h>
    4243
    4344
     
    4546{
    4647  /* class to handle chat using an InputBuffer */
    47   class _OrxonoxExport ChatInputHandler
     48  class _OrxonoxExport ChatInputHandler : public Singleton<ChatInputHandler>
    4849  {
    4950    private:
     
    5960      /** constructor */
    6061      ChatInputHandler();
     62      friend class Singleton<ChatInputHandler>;
     63
     64      /* start listening, stop listening */
     65      void activate();
     66      void deactivate();
    6167
    6268      void inputChanged();
Note: See TracChangeset for help on using the changeset viewer.