35 |
#include <cstdlib> |
#include <cstdlib> |
36 |
#include <cstdarg> |
#include <cstdarg> |
37 |
#include <iostream> |
#include <iostream> |
38 |
|
#include <iomanip> |
39 |
#include <cassert> |
#include <cassert> |
40 |
|
|
41 |
using namespace std; |
using namespace std; |
227 |
va_list arg_ptr; |
va_list arg_ptr; |
228 |
|
|
229 |
va_start(arg_ptr, format); |
va_start(arg_ptr, format); |
230 |
cerr << "non-grid-\"" << get_kind() << "\": " |
cerr << setbase(16) << long(this) << " non-grid-\"" << get_kind() << "\": " |
231 |
<< vstrf(format, arg_ptr) << '\n'; |
<< vstrf(format, arg_ptr) << '\n'; |
232 |
va_end(arg_ptr); |
va_end(arg_ptr); |
233 |
} |
} |
247 |
const GridPos& pos = get_pos(); |
const GridPos& pos = get_pos(); |
248 |
|
|
249 |
va_start(arg_ptr, format); |
va_start(arg_ptr, format); |
250 |
cerr << "\"" << get_kind() << "\" at " << pos.x << '/' << pos.y << ": " |
cerr << setbase(16) << long(this) << " \"" << get_kind() << '\"' |
251 |
|
<< setbase(8) << " at " << pos.x << '/' << pos.y << ": " |
252 |
<< vstrf(format, arg_ptr) << '\n'; |
<< vstrf(format, arg_ptr) << '\n'; |
253 |
va_end(arg_ptr); |
va_end(arg_ptr); |
254 |
} |
} |
1833 |
} |
} |
1834 |
} |
} |
1835 |
} |
} |
1836 |
|
|
1837 |
void actor_inside(Actor *a) { |
void actor_inside(Actor *a) { |
1838 |
SendMessage(a, "shatter"); |
SendMessage(a, "shatter"); |
1839 |
} |
} |
1840 |
|
|
1841 |
void actor_contact(Actor *a) { |
void actor_contact(Actor *a) { |
1842 |
if (state == GROWING) { |
if (state == GROWING) { |
1843 |
SendMessage(a, "shatter"); |
SendMessage(a, "shatter"); |
2599 |
|
|
2600 |
void actor_hit(const StoneContact &sc) |
void actor_hit(const StoneContact &sc) |
2601 |
{ |
{ |
2602 |
|
|
2603 |
if ( state == IDLE) { |
if ( state == IDLE) { |
2604 |
if (sc.actor) |
if (sc.actor) |
2605 |
state = ON; |
state = ON; |
2609 |
set_anim("st-time1switch"); |
set_anim("st-time1switch"); |
2610 |
} |
} |
2611 |
} |
} |
2612 |
|
|
2613 |
void animcb() { |
void animcb() { |
2614 |
if (state == ON) { |
if (state == ON) { |
2615 |
set_on(!is_on()); |
set_on(!is_on()); |