#include <filter.h>
Public Types | |
typedef tFilterValueType | int2 |
Public Methods | |
TFilter () | |
TFilter (string &FilterDescription, tFilterValueType filterValue) | |
TFilter (const TFilter &otherFilter) | |
virtual | ~TFilter () |
virtual void | setFilterValue (tFilterVauleType filterValue) |
virtual tFilterType | getFilterValue () |
virtual void | setFilterDescription (string &filterDescription) |
virtual string & | getFilterDescription () const |
virtual TFilter & | operator+ (const TFilter &filterToAdd) const |
virtual TFilter & | operator= (const TFilter &otherFilter) |
virtual bool | operator== (const TFilter &otherFilter) const |
Protected Attributes | |
FilterValueType | fFilterValue |
string | fFilterDescription |
The class TFilter represents the amout of information a stellar object is able to percept of an other stellar object. At the moment the value for the amount is an integer value. The value can be between -1 and 100. The value 0 means no information at all, 100 means the observer gets absolutely correct informations and all value between mean the observer gets values which are not exact, but can differ by (100 - filter value)% from the real value. The value -1 represents completely random values and the observer is not aware that these values are completly random. Furthermore the contains a dtring with a description of the object which is percepted. For example it could be "population" if the filter is conected with the population of a planet.
|
Type definition for the filter value, so it's easier to change the type if needed. |
|
This constructor creates a new Filter object. The filter will be initialized with zero perception and an empty filter description. |
|
This constructor creates a new Filter object. You can specify the value of the filter and its description as parameters.
|
|
The copy constructor creates a new Filter object using the values of filter given as parameter as initialization values.
|
|
The destructor frees the used memeory (at the moment it's nothing). |
|
The method getFilterDescription returns the filter description (that's the description of the object which is observed).
|
|
With the method getFilterValue you can get the value of the filter. For further information about the meaning of the filter values look in the description of the class or the method setFilterValue.
|
|
This method implements the operator+ method. It returns a filter object, which has the value set to the addition/combination of the filter values of both filters. For now that is simply the greater one of both values. Neither of the filters is changed. The filter descriptions HAVE to be equal. If they are different, they cannot be connected to the same perceived object and they cannot be added. Thus, if they ae different, a fatal error is reported and the program is exits.
|
|
This method implements the operator= method. It just assigns the new value to the filter.
|
|
This method implements the operator== method. It returns
|
|
The method setFilterDescription sets the filter description (that is the description of the object which is observed) to the value given as parameter.
|
|
With the method setFilterValue you can set the value of the filter. Values can be integers between -1 and 100, where 100 is correct perception, -1 is complete random values and numbers between 0 and 99 stand for probability range. That means, the percepted values can differ by (100 - filter value)%.
|
|
the internal variable to save the description of the object, which is observed and to which the filter is linked to |
|
the internal variable for the filter value; for further information about the meaning of the filter values look in the description of the class or the method setFilterValue. |