| jjacek | says | The problem being that inventory items have two internal "types", yet neither reflects the full spectrum of actual user-visible types |
| jjacek | says | The solution is to augment those types with a new class attribute, then phase out use of the other two types until they are replaced |
| jjacek | says | By using a bitfield, with each possible type being represented as a power of two (1, 2, 4, |
| jjacek | ... the new type field also becomes useful as a grouping and filtering tool, using bitwise comparisons (& and |). |
| jjacek | says | For example, if shirts were type 1 and pants were type 2 (ignoring the rest for this example), "clothes" would be 1|2, i.e. 3 |
| jjacek | says | And we can further group it -- if clothes is 3 and bodyparts is, say, 12, then "wearables" would be 3|12 = 15 |
| jjacek | says | This allows comparisons using both equality (to see if the type is *exactly* something)... |
| jjacek | ... or by bitwise ORing (to see if it's one of several somethings). |
| ismelina |
| jjacek | says | This property makes it especially useful for filtering, and would actually simplify the filtering code quite a bit! |
| jjacek | *ahem* I'm done now. |
| jjacek | (Done describing it, that is -- now I have to *do* it!) |
| Damo | Someone needs to help me gather up the pieces of my brain.. they're all over the room |
| jjacek | says | I warned you |
| Ali Moxie | awesome, I so will not admit to following all of that |
| jjacek | hopes | she has the C++ skillz to pull this off. |
| CoyotePacə | says | 12 ? |
| jjacek | asks | 12 what? |
| CoyotePacə | says | ah, I didn't pick up that 'bodyparts' was a composite type in this example (so I was wondering why it was assigned a non-power of 2) |
| jjacek | says | Oh, right. |
| Tenebrous | wonders how many different types there really are? |
| jjacek | says | I've defined 24 types, including 9 clothing and 4 bodyparts, visited and unvisited landmarks, online and offline calling cards, etc |
| Tenebrous | thinks | this is long overdue |
| Smiley | thinks | he is not geek enough to get that. Because he does not get that. O.o |
| Tenebrous | got it so hah |
| CoyotePacə | says | Tenebrous probably has that curse where seeing a number like 4096 causes a little clicking sound in your head |
| Tenebrous | laughs - totally! |
| DaleInnis | wonders | if jjacek knows what makes some clothes show up with generic "clothes" icon in inv, rather than shirt, jacket, pants, etc icon? |
| jjacek | says | So, I guess the asset servers forgot which type. |
| Trini | thinks | asset servers do not have time to forget... they're too busy losing our stuff. |
| DaleInnis | says | oooooo inneresting! That would explain why it's almost always really old things... |
© copyright 2007-2012 Plurk Search People Search Verified Account APIFAQ
Contact Us About Blog Jobs Terms Privacy
