/[enigma]/enigma/src/objects.cc
ViewVC logotype

Diff of /enigma/src/objects.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by dheck, Wed Feb 12 23:16:45 2003 UTC revision 1.19 by dheck, Fri Feb 14 19:04:51 2003 UTC
# Line 502  Stone::Stone(const char * kind) Line 502  Stone::Stone(const char * kind)
502      : TGridObject<GRID_STONES>(kind)      : TGridObject<GRID_STONES>(kind)
503  {}  {}
504    
 Stone::~Stone()  
 {  
     world::KillRubberBands(this);  
 }  
   
 void  
 Stone::on_removal()  
 {  
     TGridObject<GRID_STONES>::on_removal();  
 }  
   
   
505  px::V3  px::V3
506  Stone::actor_impulse(const StoneContact &sc)  Stone::actor_impulse(const StoneContact &sc)
507  {  {
# Line 3478  ObjectRepos::get_template(const string & Line 3466  ObjectRepos::get_template(const string &
3466  //----------------------------------------------------------------------  //----------------------------------------------------------------------
3467  namespace  namespace
3468  {  {
3469      ObjectRepos repos;      ObjectRepos *repos;
3470  }  }
3471    
3472  void  void
3473  world::Register(Object *obj)  world::Register(Object *obj)
3474  {  {
3475      repos.add_templ(obj);      if (!repos)
3476            repos = new ObjectRepos;
3477        repos->add_templ(obj);
3478  }  }
3479    
3480  Object *  Object *
# Line 3495  world::MakeObject(const char *kind) Line 3485  world::MakeObject(const char *kind)
3485    
3486      if (last_kind!=kind) {      if (last_kind!=kind) {
3487          last_kind = kind;          last_kind = kind;
3488          last_templ = repos.get_template(kind);          last_templ = repos->get_template(kind);
3489      }      }
3490    
3491      Object *o = 0;      Object *o = 0;
# Line 3509  world::MakeObject(const char *kind) Line 3499  world::MakeObject(const char *kind)
3499  Object *  Object *
3500  world::GetObjectTemplate(const std::string &kind)  world::GetObjectTemplate(const std::string &kind)
3501  {  {
3502      if (!repos.has_templ(kind)) {      if (!repos->has_templ(kind)) {
3503          cerr << "GetObjectTemplate: unkown object name `" <<kind<< "'.\n";          cerr << "GetObjectTemplate: unkown object name `" <<kind<< "'.\n";
3504          return 0;          return 0;
3505      } else      } else
3506          return repos.get_template(kind);          return repos->get_template(kind);
3507  }  }
3508    
3509    

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26