Freeciv-3.3
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
fix_enabler_item Class Reference
+ Inheritance diagram for fix_enabler_item:

Public Member Functions

 fix_enabler_item (struct action_enabler *enabler)
 
virtual ~fix_enabler_item ()
 
void close ()
 
const voiditem ()
 
voiditem_working_copy ()
 
const charname ()
 
struct req_vec_problemfind_next_problem (void)
 
void apply_accepted_changes ()
 
void undo_accepted_changes ()
 
int num_vectors ()
 
requirement_vector_namer vector_namer ()
 
requirement_vector_by_number vector_getter ()
 
bool vector_in_item (const struct requirement_vector *vec)
 
- Public Member Functions inherited from req_vec_fix_item
virtual ~req_vec_fix_item ()
 

Private Attributes

struct action_enablercurrent_enabler
 
struct action_enablerlocal_copy
 
QString my_name
 

Detailed Description

Definition at line 42 of file tab_enablers.cpp.

Constructor & Destructor Documentation

◆ fix_enabler_item()

fix_enabler_item::fix_enabler_item ( struct action_enabler enabler)
explicit

Construct fix_enabler_item to help req_vec_fix with the action enabler unique stuff.

Definition at line 450 of file tab_enablers.cpp.

◆ ~fix_enabler_item()

fix_enabler_item::~fix_enabler_item ( )
virtual

Destructor for fix_enabler_item

Definition at line 473 of file tab_enablers.cpp.

Member Function Documentation

◆ apply_accepted_changes()

void fix_enabler_item::apply_accepted_changes ( )
virtual

Do all the changes the user has accepted to the ruleset item. N.B.: This could be called before all problems are fixed if the user wishes to try to fix problems by hand or to come back and fix the remaining problems later.

Implements req_vec_fix_item.

Definition at line 538 of file tab_enablers.cpp.

◆ close()

void fix_enabler_item::close ( )
virtual

Tell the helper that it has outlived its usefulnes.

Implements req_vec_fix_item.

Definition at line 481 of file tab_enablers.cpp.

◆ find_next_problem()

struct req_vec_problem * fix_enabler_item::find_next_problem ( void  )
virtual

Returns the next detected requirement vector problem for the ruleset item or nullptr if no fix is found to be needed. Caller needs to free the result with req_vec_problem_free()

Returns
the next requirement vector problem for the item.

Implements req_vec_fix_item.

Definition at line 521 of file tab_enablers.cpp.

◆ item()

const void * fix_enabler_item::item ( )
virtual

Returns a pointer to the ruleset item.

Returns
a pointer to the ruleset item.

Implements req_vec_fix_item.

Definition at line 490 of file tab_enablers.cpp.

◆ item_working_copy()

void * fix_enabler_item::item_working_copy ( )
virtual

Returns a pointer to the working copy of the ruleset item.

Returns
a pointer to the working copy of the ruleset item.

Implements req_vec_fix_item.

Definition at line 499 of file tab_enablers.cpp.

◆ name()

const char * fix_enabler_item::name ( )
virtual

Returns a name to describe the item, hopefully good enough to distinguish it from other items. Must be short enough for a quick mention.

Returns
a (not always unique) name for the ruleset item.

Implements req_vec_fix_item.

Definition at line 510 of file tab_enablers.cpp.

◆ num_vectors()

int fix_enabler_item::num_vectors ( )
virtual

Returns the number of requirement vectors in this item.

Returns
the number of requirement vectors the item has.

Implements req_vec_fix_item.

Definition at line 570 of file tab_enablers.cpp.

◆ undo_accepted_changes()

void fix_enabler_item::undo_accepted_changes ( )
virtual

Undo all the changes the user has accepted to the ruleset item. N.B.: This could be called after all problems are fixed if the user wishes to see all problems and try to fix them by hand.

Implements req_vec_fix_item.

Definition at line 554 of file tab_enablers.cpp.

◆ vector_getter()

requirement_vector_by_number fix_enabler_item::vector_getter ( )
virtual

Returns a function pointer to a function that returns a writable pointer to the specified requirement vector in the specified parent item.

Returns
a writable pointer to the requirement vector getter function.

Implements req_vec_fix_item.

Definition at line 594 of file tab_enablers.cpp.

◆ vector_in_item()

bool fix_enabler_item::vector_in_item ( const struct requirement_vector vec)
virtual

Check if the specified vector belongs to this item

Parameters
vecthe requirement vector that may belong to this item.
Returns
true iff the vector belongs to this item.

Implements req_vec_fix_item.

Definition at line 605 of file tab_enablers.cpp.

◆ vector_namer()

requirement_vector_namer fix_enabler_item::vector_namer ( )
virtual

Returns a function pointer to a function that names this item kind's requirement vector number number. Useful when there is more than one requirement vector.

Returns
the requirement vector namer for ruleset items of this kind.

Implements req_vec_fix_item.

Definition at line 582 of file tab_enablers.cpp.

Field Documentation

◆ current_enabler

struct action_enabler* fix_enabler_item::current_enabler
private

◆ local_copy

struct action_enabler* fix_enabler_item::local_copy
private

◆ my_name

QString fix_enabler_item::my_name
private

Definition at line 63 of file tab_enablers.cpp.

Referenced by fix_enabler_item(), and name().