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 |
{ |
{ |
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 * |
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; |
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 |
|
|