Skip to main content
edited body
Source Link

In mumy opinion I these variables should be treated separately. Use your properties methods as just interactor to that one variable alone. Putting logic in them is a bit smelly I think. The setter for the Divider but should only set its self. I would be tempted to use the boolean as a toggle between divide and multiplication and the multiplication value as the value you operate with.

(Do you even need the value if you have a value that can do negative to divide? Could you have a negative value and just do x * value? My brain isn't thinking maths atm so apologies for this jabber.

If this isn't possible then use the value as only positive and your factor and the bool as your operation type. This would eliminate your need for the toggle with value change. If this is something that is needed else where then this should be an interactor function which you call as it is interacting between the two variables. Using the inspector should edit properties seperately. If you have a variable that is effected by the other like time that then works out mph at a speed this should go in a function rather than being effected on a property change.

Sorry if this is a mess, hope helps in some way.

In mu opinion I these variables should be treated separately. Use your properties methods as just interactor to that one variable alone. Putting logic in them is a bit smelly I think. The setter for the Divider but should only set its self. I would be tempted to use the boolean as a toggle between divide and multiplication and the multiplication value as the value you operate with.

(Do you even need the value if you have a value that can do negative to divide? Could you have a negative value and just do x * value? My brain isn't thinking maths atm so apologies for this jabber.

If this isn't possible then use the value as only positive and your factor and the bool as your operation type. This would eliminate your need for the toggle with value change. If this is something that is needed else where then this should be an interactor function which you call as it is interacting between the two variables. Using the inspector should edit properties seperately. If you have a variable that is effected by the other like time that then works out mph at a speed this should go in a function rather than being effected on a property change.

Sorry if this is a mess, hope helps in some way.

In my opinion I these variables should be treated separately. Use your properties methods as just interactor to that one variable alone. Putting logic in them is a bit smelly I think. The setter for the Divider but should only set its self. I would be tempted to use the boolean as a toggle between divide and multiplication and the multiplication value as the value you operate with.

(Do you even need the value if you have a value that can do negative to divide? Could you have a negative value and just do x * value? My brain isn't thinking maths atm so apologies for this jabber.

If this isn't possible then use the value as only positive and your factor and the bool as your operation type. This would eliminate your need for the toggle with value change. If this is something that is needed else where then this should be an interactor function which you call as it is interacting between the two variables. Using the inspector should edit properties seperately. If you have a variable that is effected by the other like time that then works out mph at a speed this should go in a function rather than being effected on a property change.

Sorry if this is a mess, hope helps in some way.

Source Link

In mu opinion I these variables should be treated separately. Use your properties methods as just interactor to that one variable alone. Putting logic in them is a bit smelly I think. The setter for the Divider but should only set its self. I would be tempted to use the boolean as a toggle between divide and multiplication and the multiplication value as the value you operate with.

(Do you even need the value if you have a value that can do negative to divide? Could you have a negative value and just do x * value? My brain isn't thinking maths atm so apologies for this jabber.

If this isn't possible then use the value as only positive and your factor and the bool as your operation type. This would eliminate your need for the toggle with value change. If this is something that is needed else where then this should be an interactor function which you call as it is interacting between the two variables. Using the inspector should edit properties seperately. If you have a variable that is effected by the other like time that then works out mph at a speed this should go in a function rather than being effected on a property change.

Sorry if this is a mess, hope helps in some way.