Freeciv-3.1: req_vec_fix_item Class Reference

Freeciv-3.1

Loading...
Searching...
No Matches
Public Member Functions
req_vec_fix_item Class Referenceabstract

`#include <req_vec_fix.h>`

Inheritance diagram for req_vec_fix_item:

## Public Member Functions

virtual void | close ()=0
virtual const void * | item ()=0
virtual void * | item_working_copy ()=0
virtual const char * | name ()=0
virtual struct req_vec_problem * | find_next_problem ()=0
virtual void | apply_accepted_changes ()=0
virtual void | undo_accepted_changes ()=0
virtual int | num_vectors ()=0
virtual requirement_vector_namer | vector_namer ()=0
virtual requirement_vector_by_number | vector_getter ()=0
virtual bool | vector_in_item (const struct requirement_vector *vec)=0
virtual | ~req_vec_fix_item ()

## Detailed Description

Ruleset entity specific methods for the ruleset item having its requirements fixed.

Definition at line 48 of file req_vec_fix.h.

## Constructor & Destructor Documentation

## ◆ ~req_vec_fix_item()

virtual req_vec_fix_item::~req_vec_fix_item | ( |  | ) |

inlinevirtual

Trivial destructor

Definition at line 130 of file req_vec_fix.h.

## Member Function Documentation

## ◆ apply_accepted_changes()

virtual void req_vec_fix_item::apply_accepted_changes | ( |  | ) |

pure 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.

Implemented in fix_enabler_item.

Referenced by req_vec_fix::accept_applied_solutions().

## ◆ close()

virtual void req_vec_fix_item::close | ( |  | ) |

pure virtual

Tell the helper that it has outlived its usefulness.

Implemented in fix_enabler_item.

Referenced by ruledit_gui::open_req_vec_fix(), and req_vec_fix::~req_vec_fix().

## ◆ find_next_problem()

virtual struct req_vec_problem * req_vec_fix_item::find_next_problem | ( |  | ) |

pure virtual

Returns the next detected requirement vector problem for the ruleset item or nullptr if no fix is found to be needed.

Returns
  the next requirement vector problem for the item.

Implemented in fix_enabler_item.

Referenced by req_vec_fix::refresh().

## ◆ item()

virtual const void * req_vec_fix_item::item | ( |  | ) |

pure virtual

Returns a pointer to the ruleset item.

Returns
  a pointer to the ruleset item.

Implemented in fix_enabler_item.

Referenced by req_vec_fix::accept_applied_solutions(), req_vec_fix::item(), and ruledit_gui::open_req_vec_fix().

## ◆ item_working_copy()

virtual void * req_vec_fix_item::item_working_copy | ( |  | ) |

pure virtual

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

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

Implemented in fix_enabler_item.

Referenced by req_vec_fix::apply_solution().

## ◆ name()

virtual const char * req_vec_fix_item::name | ( |  | ) |

pure 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.

Implemented in fix_enabler_item.

Referenced by req_vec_fix::apply_solution(), and req_vec_fix_problem::req_vec_fix_problem().

## ◆ num_vectors()

virtual int req_vec_fix_item::num_vectors | ( |  | ) |

pure virtual

Returns the number of requirement vectors in this item.

Returns
  the number of requirement vectors the item has.

Implemented in fix_enabler_item.

Referenced by req_vec_fix::accept_applied_solutions().

## ◆ undo_accepted_changes()

virtual void req_vec_fix_item::undo_accepted_changes | ( |  | ) |

pure 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.

Implemented in fix_enabler_item.

Referenced by req_vec_fix::reject_applied_solutions().

## ◆ vector_getter()

virtual requirement_vector_by_number req_vec_fix_item::vector_getter | ( |  | ) |

pure 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.

Implemented in fix_enabler_item.

Referenced by req_vec_fix::accept_applied_solutions(), and req_vec_fix::apply_solution().

## ◆ vector_in_item()

virtual bool req_vec_fix_item::vector_in_item | ( | const struct requirement_vector * | vec | ) |

pure virtual

Check if the specified vector belongs to this item

Parameters

  vec | the requirement vector that may belong to this item.

Returns
  true iff the vector belongs to this item.

Implemented in fix_enabler_item.

Referenced by req_vec_fix::incoming_req_vec_change().

## ◆ vector_namer()

virtual requirement_vector_namer req_vec_fix_item::vector_namer | ( |  | ) |

pure 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.

Implemented in fix_enabler_item.

Referenced by req_vec_fix::apply_solution(), and req_vec_fix_problem::req_vec_fix_problem().