Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/remove stuff11 #1132

Merged
merged 6 commits into from
Jul 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove stuff:/client/goto.[cpp|h] diplodlg.cpp
psampathkumar committed Jul 14, 2022
commit 52924857163dbe58a75cd78aae894a40021578f8
3 changes: 0 additions & 3 deletions client/diplodlg.cpp
Original file line number Diff line number Diff line change
@@ -39,9 +39,6 @@
#include "sprite.h"
#include "top_bar.h"

typedef advance *p_advance;
typedef city *p_city;

/**
Constructor for diplomacy widget
*/
39 changes: 0 additions & 39 deletions client/goto.cpp
Original file line number Diff line number Diff line change
@@ -296,45 +296,6 @@ void goto_unit_killed(struct unit *punit)
*/
bool goto_is_active() { return !goto_finders.empty(); }

/**
Return the path length (in turns).
WARNING: not useful for determining paths of scattered groups.
*/
bool goto_get_turns(int *min, int *max)
{
fc_assert_ret_val(min != nullptr, false);
fc_assert_ret_val(max != nullptr, false);

*min = FC_INFINITY;
*max = -1;

if (!goto_is_active()) {
return false;
}
if (nullptr == goto_destination) {
// Not a valid position.
return false;
}

if (hover_state == HOVER_CONNECT) {
// FIXME unsupported
} else {
// In other modes, we want to know the turn number to reach the tile.
for (auto &[unit_id, finder] : goto_finders) {
auto destination = hover_state == HOVER_PATROL
? game_unit_by_number(unit_id)->tile
: goto_destination;
auto path = finder.find_path(freeciv::tile_destination(destination));
if (path) {
*min = std::max(*min, path->turns());
*max = std::max(*max, path->turns());
}
}
}

return true;
}

/**
Returns the state of 'ptile': turn number to print, and whether 'ptile'
is a waypoint.
3 changes: 0 additions & 3 deletions client/goto.h
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@ void exit_goto_state();
void goto_unit_killed(struct unit *punit);

bool goto_is_active();
bool goto_get_turns(int *min, int *max);
bool goto_tile_state(const struct tile *ptile, enum goto_tile_state *state,
int *turns, bool *waypoint);
bool goto_add_waypoint();
@@ -45,8 +44,6 @@ bool is_valid_goto_destination(const struct tile *ptile);
bool is_valid_goto_draw_line(struct tile *dest_tile);

void request_orders_cleared(struct unit *punit);
void send_goto_path(struct unit *punit, PFPath *path,
struct unit_order *last_order);
void send_rally_path(city *pcity, unit *punit, const PFPath &path,
unit_order *final_order);
bool send_goto_tile(struct unit *punit, struct tile *ptile);