示例#1
0
void game_display::invalidate_unit_after_move(const map_location& src, const map_location& dst)
{
	if (src == displayedUnitHex_) {
		displayedUnitHex_ = dst;
		invalidate_unit();
	}
}
示例#2
0
void game_display::display_unit_hex(map_location hex)
{
	unit_map::const_iterator u = find_visible_unit(units_, hex, get_map(), teams_, teams_[viewing_team()], !viewpoint_);
	if (u != units_.end()) {
		displayedUnitHex_ = hex;
		invalidate_unit();
	}
}
示例#3
0
void game_display::display_unit_hex(map_location hex)
{
	const unit *u = get_visible_unit(units_, hex, teams_[viewing_team()], !viewpoint_);
	if (u) {
		displayedUnitHex_ = hex;
		invalidate_unit();
	}
}
示例#4
0
void game_display::highlight_hex(map_location hex)
{
	unit_map::const_iterator u = find_visible_unit(units_, hex, get_map(), teams_, teams_[viewing_team()], !viewpoint_);
	if (u != units_.end()) {
		displayedUnitHex_ = hex;
		invalidate_unit();
	} else {
		u = find_visible_unit(units_, mouseoverHex_, get_map(), teams_, teams_[viewing_team()], !viewpoint_);
		if (u != units_.end()) {
			// mouse moved from unit hex to non-unit hex
			if (units_.count(selectedHex_)) {
				displayedUnitHex_ = selectedHex_;
				invalidate_unit();
			}
		}
	}

	display::highlight_hex(hex);
	invalidate_game_status();
}
示例#5
0
void game_display::highlight_hex(map_location hex)
{
	const unit *u = get_visible_unit(units_, hex, teams_[viewing_team()], !viewpoint_);
	if (u) {
		displayedUnitHex_ = hex;
		invalidate_unit();
	} else {
		u = get_visible_unit(units_, mouseoverHex_, teams_[viewing_team()], !viewpoint_);
		if (u) {
			// mouse moved from unit hex to non-unit hex
			if (units_.count(selectedHex_)) {
				displayedUnitHex_ = selectedHex_;
				invalidate_unit();
			}
		}
	}

	display::highlight_hex(hex);
	invalidate_game_status();
}
示例#6
0
void game_display::display_unit_hex(map_location hex)
{
	if (!hex.valid())
		return;

	wb::future_map future; /**< Lasts for whole method. */

	const unit *u = resources::gameboard->get_visible_unit(hex, dc_->teams()[viewing_team()], !dont_show_all_);
	if (u) {
		displayedUnitHex_ = hex;
		invalidate_unit();
	}
}
示例#7
0
void game_display::highlight_hex(map_location hex)
{
	wb::future_map future; /**< Lasts for whole method. */

	const unit *u = resources::gameboard->get_visible_unit(hex, dc_->teams()[viewing_team()], !dont_show_all_);
	if (u) {
		displayedUnitHex_ = hex;
		invalidate_unit();
	} else {
		u = resources::gameboard->get_visible_unit(mouseoverHex_, dc_->teams()[viewing_team()], !dont_show_all_);
		if (u) {
			// mouse moved from unit hex to non-unit hex
			if (dc_->units().count(selectedHex_)) {
				displayedUnitHex_ = selectedHex_;
				invalidate_unit();
			}
		}
	}

	display::highlight_hex(hex);
	invalidate_game_status();
}
示例#8
0
void game_display::display_unit_hex(map_location hex)
{
	if (!hex.valid())
		return;

	wb::future_map future; //< Lasts for whole method.

	const unit *u = get_visible_unit(hex, (*teams_)[viewing_team()], !viewpoint_);
	if (u) {
		displayedUnitHex_ = hex;
		invalidate_unit();
	}
}
示例#9
0
void game_display::highlight_hex(map_location hex)
{
	wb::future_map future; //< Lasts for whole method.

	const unit *u = get_visible_unit(hex, (*teams_)[viewing_team()], !viewpoint_);
	if (u) {
		displayedUnitHex_ = hex;
		invalidate_unit();
	} else {
		u = get_visible_unit(mouseoverHex_, (*teams_)[viewing_team()], !viewpoint_);
		if (u) {
			// mouse moved from unit hex to non-unit hex
			if (units_->count(selectedHex_)) {
				displayedUnitHex_ = selectedHex_;
				invalidate_unit();
			}
		}
	}

	display::highlight_hex(hex);
	invalidate_game_status();
}