251
251
gboolean game_remove_connected_tiles (Game* self, Tile* tile);
252
252
gboolean game_view_board_left_cb (GameView* self);
253
253
void game_reset_visit (Game* self);
254
static TileActor* game_view_find_tile_at_position (GameView* self, gint position_x, gint position_y);
254
255
void game_view_cursor_move (GameView* self, gint x, gint y);
255
256
gint game_view_get_cursor_x (GameView* self);
256
257
gint game_view_get_cursor_y (GameView* self);
1040
static TileActor* game_view_find_tile_at_position (GameView* self, gint position_x, gint position_y) {
1041
TileActor* result = NULL;
1042
TileActor** _tmp0_ = NULL;
1043
gint _tmp0__length1 = 0;
1044
gint _tmp0__length2 = 0;
1045
g_return_val_if_fail (self != NULL, NULL);
1046
_tmp0_ = self->priv->tiles;
1047
_tmp0__length1 = self->priv->tiles_length1;
1048
_tmp0__length2 = self->priv->tiles_length2;
1050
TileActor** actor_collection = NULL;
1051
gint actor_collection_length1 = 0;
1052
gint actor_collection_length2 = 0;
1054
actor_collection = _tmp0_;
1055
actor_collection_length1 = _tmp0__length1 * _tmp0__length2;
1056
for (actor_it = 0; actor_it < (_tmp0__length1 * _tmp0__length2); actor_it = actor_it + 1) {
1057
TileActor* _tmp1_ = NULL;
1058
TileActor* actor = NULL;
1059
_tmp1_ = _g_object_ref0 (actor_collection[actor_it]);
1062
gboolean _tmp2_ = FALSE;
1063
TileActor* _tmp3_ = NULL;
1064
Tile* _tmp4_ = NULL;
1068
_tmp4_ = _tmp3_->tile;
1069
_tmp5_ = _tmp4_->grid_x;
1070
_tmp6_ = position_x;
1071
if (_tmp5_ == _tmp6_) {
1072
TileActor* _tmp7_ = NULL;
1073
Tile* _tmp8_ = NULL;
1077
_tmp8_ = _tmp7_->tile;
1078
_tmp9_ = _tmp8_->grid_y;
1079
_tmp10_ = position_y;
1080
_tmp2_ = _tmp9_ == _tmp10_;
1088
_g_object_unref0 (actor);
1039
1097
void game_view_cursor_move (GameView* self, gint x, gint y) {
1040
1098
TileActor* _tmp0_ = NULL;
1041
1099
gint _tmp1_ = 0;
1044
1102
gint _tmp4_ = 0;
1045
1103
gint _tmp5_ = 0;
1046
1104
gint _tmp6_ = 0;
1047
TileActor** _tmp7_ = NULL;
1048
gint _tmp7__length1 = 0;
1049
gint _tmp7__length2 = 0;
1050
1106
gint _tmp8_ = 0;
1051
1107
gint _tmp9_ = 0;
1052
1108
gint _tmp10_ = 0;
1109
TileActor* _tmp11_ = NULL;
1054
1110
TileActor* _tmp12_ = NULL;
1055
TileActor* _tmp13_ = NULL;
1056
TileActor* _tmp14_ = NULL;
1057
1111
gfloat xx = 0.0F;
1058
1112
gfloat yy = 0.0F;
1059
1114
gint _tmp15_ = 0;
1060
1115
gint _tmp16_ = 0;
1116
Game* _tmp17_ = NULL;
1062
1117
Game* _tmp18_ = NULL;
1063
Game* _tmp19_ = NULL;
1064
1119
gint _tmp20_ = 0;
1065
1120
gint _tmp21_ = 0;
1066
1121
gint _tmp22_ = 0;
1067
1122
gint _tmp23_ = 0;
1123
CursorActor* _tmp24_ = NULL;
1069
1124
CursorActor* _tmp25_ = NULL;
1070
CursorActor* _tmp26_ = NULL;
1071
1125
g_return_if_fail (self != NULL);
1072
1126
self->priv->cursor_active = TRUE;
1073
1127
_tmp0_ = self->priv->highlighted;
1080
1134
_tmp5_ = _tmp4_;
1082
1136
game_view_set_cursor_y (self, _tmp5_ + _tmp6_);
1083
_tmp7_ = self->priv->tiles;
1084
_tmp7__length1 = self->priv->tiles_length1;
1085
_tmp7__length2 = self->priv->tiles_length2;
1086
_tmp8_ = game_view_get_cursor_x (self);
1088
_tmp10_ = game_view_get_cursor_y (self);
1090
_tmp12_ = _tmp7_[(_tmp9_ * _tmp7__length2) + _tmp11_];
1091
_tmp13_ = _g_object_ref0 (_tmp12_);
1137
_tmp7_ = game_view_get_cursor_x (self);
1139
_tmp9_ = game_view_get_cursor_y (self);
1141
_tmp11_ = game_view_find_tile_at_position (self, _tmp8_, _tmp10_);
1092
1142
_g_object_unref0 (self->priv->highlighted);
1093
self->priv->highlighted = _tmp13_;
1094
_tmp14_ = self->priv->highlighted;
1095
game_view_opacity_for_connected_tiles (self, _tmp14_, 255);
1096
_tmp15_ = game_view_get_cursor_x (self);
1098
_tmp17_ = self->priv->tile_size;
1099
xx = (gfloat) (_tmp16_ * _tmp17_);
1100
_tmp18_ = game_view_get_game (self);
1102
_tmp20_ = game_get_rows (_tmp19_);
1104
_tmp22_ = game_view_get_cursor_y (self);
1106
_tmp24_ = self->priv->tile_size;
1107
yy = (gfloat) (((_tmp21_ - 1) - _tmp23_) * _tmp24_);
1143
self->priv->highlighted = _tmp11_;
1144
_tmp12_ = self->priv->highlighted;
1145
if (_tmp12_ != NULL) {
1146
TileActor* _tmp13_ = NULL;
1147
_tmp13_ = self->priv->highlighted;
1148
game_view_opacity_for_connected_tiles (self, _tmp13_, 255);
1150
_tmp14_ = game_view_get_cursor_x (self);
1152
_tmp16_ = self->priv->tile_size;
1153
xx = (gfloat) (_tmp15_ * _tmp16_);
1154
_tmp17_ = game_view_get_game (self);
1156
_tmp19_ = game_get_rows (_tmp18_);
1158
_tmp21_ = game_view_get_cursor_y (self);
1160
_tmp23_ = self->priv->tile_size;
1161
yy = (gfloat) (((_tmp20_ - 1) - _tmp22_) * _tmp23_);
1162
_tmp24_ = self->priv->cursor;
1163
clutter_actor_set_position ((ClutterActor*) _tmp24_, xx, yy);
1108
1164
_tmp25_ = self->priv->cursor;
1109
clutter_actor_set_position ((ClutterActor*) _tmp25_, xx, yy);
1110
_tmp26_ = self->priv->cursor;
1111
clutter_actor_show ((ClutterActor*) _tmp26_);
1165
clutter_actor_show ((ClutterActor*) _tmp25_);