Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualturch

Posted 27 January 2012 - 08:25 AM

You can make the data structure that holds who registered for a message be a tree: each node has a list of objects listening for that message and a hash map of children, with each level becoming more specific. For example, when someone registers with the root node, they get all messages. The root node has two children in its hash map, triggerOnTouch and buttonActivated (or whatever other messages). When an object registers with the triggerOnTouch node, it only gets all triggerOnTouch events. The triggerOnTouch node's hash map contains the nodes for a specific triggerID, so when an object registers with it, it would get only triggerOnTouch events sent by something with that specific id.

Its kind of like a BHV tree, but for messages. I've used this before and it works really well both from a usability and performance standpoint.

#4turch

Posted 27 January 2012 - 08:24 AM

You can make the data structure that holds who registered for a message be a tree: each node has a list of objects listening for that message and a hash map of children, with each level becoming more specific. For example, when someone registers with the root node, they get all messages. The root node has two children in its hash map, triggerOnTouch and buttonActivated (or whatever other messages). When an object registers with the triggerOnTouch node, it only gets all triggerOnTouch events. The triggerOnTouch node's hash map contains the nodes for a specific triggerID. Its kind of like a BHV tree, but for messages. I've used this before and it works really well both from a usability and performance standpoint.

#3turch

Posted 27 January 2012 - 08:24 AM

You can make the data structure that holds who registered for a message be a tree: each node has a list of objects listening for that message and a hash map of children, with each level becoming more specific. For example, when someone registers with the root node, they get all messages. The root node has two children in its hash map, triggerOnTouch and buttonActivated (or whatever other message). When an object registers with the triggerOnTouch node, it only gets all triggerOnTouch events. The triggerOnTouch node's hash map contains the nodes for a specific triggerID. Its kind of like a BHV tree, but for messages. I've used this before and it works really well both from a usability and performance standpoint.

#2turch

Posted 27 January 2012 - 08:23 AM

You can make the data structure that holds who registered for a message be a tree: each node has a list of objects listening for that message and a hash map of children, with each element becoming more specific. For example, when someone registers with the root node, they get all messages. The root node has two children in its hash map, triggerOnTouch and buttonActivated (or whatever other message). When an object registers with the triggerOnTouch node, it only gets all triggerOnTouch events. The triggerOnTouch node's hash map contains the nodes for a specific triggerID. Its kind of like a BHV tree, but for messages. I've used this before and it works really well both from a usability and performance standpoint.

#1turch

Posted 27 January 2012 - 08:23 AM

You can the data structure that holds who registered for a message be a tree: each node has a list of objects listening for that message and a hash map of children, with each element becoming more specific. For example, when someone registers with the root node, they get all messages. The root node has two children in its hash map, triggerOnTouch and buttonActivated (or whatever other message). When an object registers with the triggerOnTouch node, it only gets all triggerOnTouch events. The triggerOnTouch node's hash map contains the nodes for a specific triggerID. Its kind of like a BHV tree, but for messages. I've used this before and it works really well both from a usability and performance standpoint.

PARTNERS