// Player selects a logic trap, then clicks on an entity that extends logic
// Gets an entity that is activiatable from logic
Logic* result = GetLogicFromMouse();
Traps.add(new logic_trap(result));
class logic_trap : Trap
{
Logic device;
public logic_trap(Logic* d)
{
device = d;
}
// assuming mutative trap system
public void trigger(Creature c)
{
device->activate();
}
}
class Logic
{
public void activate();
}
class boulder : Logic
{
public void activate()
{
spawnboulder();
}
}