Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualfir

Posted 06 September 2013 - 03:30 AM

LorenzoGatti already said what I wanted to say after reading the question.

In general (in my opinion) you can have a look at who is reading the variables value and who is setting it. In this example it's clearly visible: the message dispatching loop reads the value so the loop loops in the preferred ratio and all other components (the input handler) are setting/adjusting the value. The input handler has to read the value though, but thats due to the lack of an "add" method so it's just a value setting. (This still is a very simple example and there may could come some more difficult cases...)
Since there is only 1 place where the variabels value matters this is the true place for the variable. The other places should be able to adjust it using the mentioned functions/methods "sleep more" and "sleep less", or "do it faster" and "slow down". If there are more components which needs exactly this value it would be more complicated to determine the right place...

 

Its mainly +/- from some keyboard handling module and mainly used in the loop

 

 

. - but there began to appear some additional settings of it

 

(as I said when working with some  modules i was overwriting its initialisation value this concrete module would like, [modules are in exclusive relation (at compile time) this is i can have 7 modules but only one is in use at a compile time but each one overwrite sleep at startup to value it is okay with that - so it is third reference (this overwriting is better I think then rewritting oryginal initialisation with hand every time I change module))]

 

 then it was also read  to display its value on the screen (hud) for debug purposes (fourth reference to sleep)

 

maybe with time it could be even referenced more

 

- So it became a  small mess like a spider legs of references- just to reach such small int value

 

- and I am something like really not happy with that - searching if there is some way of clearing/redesign that 


#5fir

Posted 06 September 2013 - 03:28 AM

LorenzoGatti already said what I wanted to say after reading the question.

In general (in my opinion) you can have a look at who is reading the variables value and who is setting it. In this example it's clearly visible: the message dispatching loop reads the value so the loop loops in the preferred ratio and all other components (the input handler) are setting/adjusting the value. The input handler has to read the value though, but thats due to the lack of an "add" method so it's just a value setting. (This still is a very simple example and there may could come some more difficult cases...)
Since there is only 1 place where the variabels value matters this is the true place for the variable. The other places should be able to adjust it using the mentioned functions/methods "sleep more" and "sleep less", or "do it faster" and "slow down". If there are more components which needs exactly this value it would be more complicated to determine the right place...

 

Its mainly +/- from some keyboard handling module and mainly used in the loop

 

 

. - but there began to appear some additional settings of it

 

(as I said when working with some  modules i was overwriting its initialisation value this concrete module would like, [modules are in exclusive relation (at compile time) this is i can have 7 modules but only one is in use at a compile time but each one overwrite sleep at startup to value it is okay with that - so it is third reference (this overwriting is better I think then rewritting oryginal initialisation with hand every time I change module))]

 

 then it was also read  to display its value on the screen (hud) for debug purposes (fourth reference to sleep)

 

maybe with time it could be even referenced more

 

- So it became a  small mess like a spider legs of references- just to reach such small int value

 

- and I am something like not happy with that - searching if there is some way of clearing/redesign that 


#4fir

Posted 06 September 2013 - 03:26 AM

LorenzoGatti already said what I wanted to say after reading the question.

In general (in my opinion) you can have a look at who is reading the variables value and who is setting it. In this example it's clearly visible: the message dispatching loop reads the value so the loop loops in the preferred ratio and all other components (the input handler) are setting/adjusting the value. The input handler has to read the value though, but thats due to the lack of an "add" method so it's just a value setting. (This still is a very simple example and there may could come some more difficult cases...)
Since there is only 1 place where the variabels value matters this is the true place for the variable. The other places should be able to adjust it using the mentioned functions/methods "sleep more" and "sleep less", or "do it faster" and "slow down". If there are more components which needs exactly this value it would be more complicated to determine the right place...

 

Its mainly +/- from some keyboard handling module and mainly used in the loop

 

 

. - but there began to appear some additional settings of it

 

(as I said when working with some  modules i was overwriting its initialisation value this concrete module would like, [modules are in exclusive relation (at compile time) this is i can have 7 modules but only one is in use at a compile time but each one overwrite sleep at startup to value it is okay with that - so it is third reference (this overwriting is better I think then rewritting oryginal initialisation with hand every time I change module))]

 

 then it was also read  to display its value on the screen (hud) for debug purposes

 

- So it became a  small mess like a spider legs of references (reaching to couple of modules for read and write) - just to reach such small int value

 

- and I am something like not happy with that - searching if there is some way of clearing/redesign that.


#3fir

Posted 06 September 2013 - 03:21 AM

LorenzoGatti already said what I wanted to say after reading the question.

In general (in my opinion) you can have a look at who is reading the variables value and who is setting it. In this example it's clearly visible: the message dispatching loop reads the value so the loop loops in the preferred ratio and all other components (the input handler) are setting/adjusting the value. The input handler has to read the value though, but thats due to the lack of an "add" method so it's just a value setting. (This still is a very simple example and there may could come some more difficult cases...)
Since there is only 1 place where the variabels value matters this is the true place for the variable. The other places should be able to adjust it using the mentioned functions/methods "sleep more" and "sleep less", or "do it faster" and "slow down". If there are more components which needs exactly this value it would be more complicated to determine the right place...

 

Its mainly +/- from some keyboard handling module and mainly used in the loop. - but there began to appear some additional settings of it (as I said when working with some

 modules i was rewriting its initialisation value this concrete module would like, modules are in exclusive relation this is i can have 7 modules but only one is in use at a time but each one rewrite sleep at startup to value it is okay with that - so it is reference (better then rewritting oryginal initialisation with hand every time I change module)) then it was also read to display its value on the screen (hud) for debug purposes - So it became a 

small mess like a spider legs of references (reaching to couple of modules for read and write) - just to reach such small int value - and I am something like not happy with that - searching if there is some way of clearing/redesign that.


#2fir

Posted 06 September 2013 - 03:18 AM

LorenzoGatti already said what I wanted to say after reading the question.

In general (in my opinion) you can have a look at who is reading the variables value and who is setting it. In this example it's clearly visible: the message dispatching loop reads the value so the loop loops in the preferred ratio and all other components (the input handler) are setting/adjusting the value. The input handler has to read the value though, but thats due to the lack of an "add" method so it's just a value setting. (This still is a very simple example and there may could come some more difficult cases...)
Since there is only 1 place where the variabels value matters this is the true place for the variable. The other places should be able to adjust it using the mentioned functions/methods "sleep more" and "sleep less", or "do it faster" and "slow down". If there are more components which needs exactly this value it would be more complicated to determine the right place...

 

Its mainly +/- from some keyboard handling module and mainly used in the loop. - but there began to appear some additional settings of it (as I said when working with some

 modules i was rewriting its initialisation value this concrete module would like) then it was also read to display its value on the screen (hud) for debug purposes - So it became a 

small mess like a spider legs of references (reaching to couple of modules for read and write) - just to reach such small int value - and I am something like not happy with that - searching if there is some way of clearing/redesign that.


#1fir

Posted 06 September 2013 - 03:11 AM

LorenzoGatti already said what I wanted to say after reading the question.

In general (in my opinion) you can have a look at who is reading the variables value and who is setting it. In this example it's clearly visible: the message dispatching loop reads the value so the loop loops in the preferred ratio and all other components (the input handler) are setting/adjusting the value. The input handler has to read the value though, but thats due to the lack of an "add" method so it's just a value setting. (This still is a very simple example and there may could come some more difficult cases...)
Since there is only 1 place where the variabels value matters this is the true place for the variable. The other places should be able to adjust it using the mentioned functions/methods "sleep more" and "sleep less", or "do it faster" and "slow down". If there are more components which needs exactly this value it would be more complicated to determine the right place...

 

Its mainly +/- from some keyboard handling module and mainly used in the loop. - but there began to appear some additional settings of it (as I said when working with some

 modules i was rewriting its initialisation value this concrete module would like) then it was also read to display its value on the screen (hud) for debug purposes - So it became a 

small mess like a spider legs of references (reaching to couple of modules for read and write)  and I am not happy with that - searching if there is some way of clearing that.


PARTNERS