Mercurial > MadButterfly
comparison examples/tank/tank_main.c @ 1060:e415c55b4a0d
Stop using ob as acronym observer
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Sun, 28 Nov 2010 12:59:05 +0800 |
parents | c693cd8c6e23 |
children | fb79175e6cc3 |
comparison
equal
deleted
inserted
replaced
1059:36aef79d68e4 | 1060:e415c55b4a0d |
---|---|
56 bullet_t *bullet_obj; | 56 bullet_t *bullet_obj; |
57 int start_map_x, start_map_y; | 57 int start_map_x, start_map_y; |
58 int direction; | 58 int direction; |
59 mb_progm_t *progm; | 59 mb_progm_t *progm; |
60 mb_timeval_t start_time; | 60 mb_timeval_t start_time; |
61 observer_t *ob_redraw; | 61 observer_t *observer_redraw; |
62 int hit_tmr; | 62 int hit_tmr; |
63 mb_timer_man_t *timer_man; | 63 mb_timer_man_t *timer_man; |
64 }; | 64 }; |
65 typedef struct _tank_bullet tank_bullet_t; | 65 typedef struct _tank_bullet tank_bullet_t; |
66 /*! \brief The direction a bullet is going. | 66 /*! \brief The direction a bullet is going. |
168 static void tank_move(tank_t *tank, int direction, | 168 static void tank_move(tank_t *tank, int direction, |
169 tank_rt_t *tank_rt) { | 169 tank_rt_t *tank_rt) { |
170 mb_rt_t *mb_rt = tank_rt->mb_rt; | 170 mb_rt_t *mb_rt = tank_rt->mb_rt; |
171 redraw_man_t *rdman; | 171 redraw_man_t *rdman; |
172 mb_timer_man_t *timer_man; | 172 mb_timer_man_t *timer_man; |
173 ob_factory_t *factory; | 173 observer_factory_t *factory; |
174 /* for the program */ | 174 /* for the program */ |
175 mb_progm_t *progm; | 175 mb_progm_t *progm; |
176 subject_t *comp_sub; | 176 subject_t *comp_sub; |
177 mb_word_t *word; | 177 mb_word_t *word; |
178 mb_timeval_t start, playing; | 178 mb_timeval_t start, playing; |
236 } | 236 } |
237 } | 237 } |
238 | 238 |
239 rdman = mb_runtime_rdman(mb_rt); | 239 rdman = mb_runtime_rdman(mb_rt); |
240 timer_man = mb_runtime_timer_man(mb_rt); | 240 timer_man = mb_runtime_timer_man(mb_rt); |
241 factory = mb_runtime_ob_factory(mb_rt); | 241 factory = mb_runtime_observer_factory(mb_rt); |
242 | 242 |
243 progm = mb_progm_new(1, rdman); | 243 progm = mb_progm_new(1, rdman); |
244 tank->progm = progm; | 244 tank->progm = progm; |
245 | 245 |
246 MB_TIMEVAL_SET(&start, 0, 0); | 246 MB_TIMEVAL_SET(&start, 0, 0); |