172 |
return false; |
return false; |
173 |
} |
} |
174 |
|
|
175 |
// Send an impulse to position 'dest' into direction dir. |
/* Send an impulse to position 'dest' into direction dir. |
176 |
// If 'dest' contains a stone, on_impulse() is called for that stone |
* If 'dest' contains a stone, on_impulse() is called for that stone |
177 |
|
*/ |
178 |
|
|
179 |
void |
void |
180 |
Object::send_impulse(const GridPos& dest, Direction dir) |
Object::send_impulse(const GridPos& dest, Direction dir) |
185 |
} |
} |
186 |
} |
} |
187 |
|
|
188 |
|
/* Like variant above, but the _result_ of the impulse is delayed. |
189 |
|
*/ |
190 |
|
|
191 |
|
void |
192 |
|
Object::send_impulse(const GridPos& dest, Direction dir, double delay) |
193 |
|
{ |
194 |
|
if (Stone *st = GetStone(dest)) { |
195 |
|
addDelayedImpulse(Impulse(this, dest, dir), delay, st); |
196 |
|
} |
197 |
|
} |
198 |
|
|
199 |
namespace { |
namespace { |
200 |
const char *vstrf(const char *format, va_list argPtr) { |
const char *vstrf(const char *format, va_list argPtr) { |
201 |
static size_t buf_size = 256; |
static size_t buf_size = 256; |
676 |
return NODIR; |
return NODIR; |
677 |
} |
} |
678 |
|
|
679 |
|
/* Move a stone (by sending an impulse) |
680 |
|
Called when actor hits a stone |
681 |
|
*/ |
682 |
bool |
bool |
683 |
Stone::maybe_push_stone (const StoneContact &sc) |
Stone::maybe_push_stone (const StoneContact &sc) |
684 |
{ |
{ |