Jump to content

What should be processed in One Tick in notification chain?


sworn

Recommended Posts

I put this question in Off Topic, cause this isn't a minecraft related, but I'll use it as an example of my question.

 

I was trying to find a Patter, a guide line of what you should process in the tick when you need to notify something else about a state change and that notification will cause more notifications.

But when I look for Patter I can only find the Notification and Observer Patterns, and if I try to look for what to process in Tick I can only find example of how Tick works and how Graphics card update it.

 

What do I have now:

  I made a Sudoku  solver,  it works fine. The point is, I was trying to make it run step by step, instead of solving everything at once. Sure I found tons of ways to do it, but I realized that I was "guessing" how to implement the notifications and how to make it runs step by step, something like an tick, not quite.

 

so it works like that: I have a main update method, that will look for one number that can't be anywhere else, and it set the number.

In the SetValue, the cell notify the Column, the Row and the Square that it has changed, then the Column, Row and the Square, notify everything else.

 

So, comparing it with the Minecraft Block, when it change state, it don't simple notify everything else that notify evetything else, it has some guide line of what you do when it change and what you don't do. Same for the next block update. Does it process the notification right away when it is called, or it add it to a queue and do it in the next tick.

 

I'm not looking for the code right now, I'm more interested in a patter, or guide line, good practices of how to approach this situation.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.