Changeset 916 – HoverRace

Changeset 916

Show
Ignore:
Timestamp:
03/14/10 01:51:55 (5 months ago)
Author:
zoogie
Message:

Added Core::Print() so any class can broadcast messages to all registered output streams.

Location:
trunk/engine/Script
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/engine/Script/Core.cpp

    r915 r916  
    170170{ 
    171171    return LUA_VERSION; 
     172} 
     173 
     174/** 
     175 * Print a message to all registered output streams. 
     176 * @param s The message to broadcast (a newline will be appended automatically). 
     177 */ 
     178void Core::Print(const std::string &s) 
     179{ 
     180    BOOST_FOREACH(boost::shared_ptr<std::ostream> &out, outs) { 
     181        *out << s << std::endl; 
     182    } 
    172183} 
    173184 
  • trunk/engine/Script/Core.h

    r902 r916  
    7575 
    7676    public: 
     77        void Print(const std::string &s); 
     78 
    7779        void Compile(const std::string &chunk); 
    7880        void CallAndPrint();