Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^3: data structure question

by daxim (Chaplain)
on Aug 30, 2013 at 14:45 UTC ( #1051647=note: print w/replies, xml ) Need Help??

in reply to Re^2: data structure question
in thread data structure question

it only requires a single call to storable

That's the justification for this amazingly sub-optimal design? ಠ_ಠ The hash key names are tight coupling, the location of the "sub-structure" is an implicit contract. That's badly reinventing the facilities of high-level programming Perl/ecosystem provides you with. It's perfectly possible to have a universe object that refers to other objects, but the design would be much more robust against changes.

Replies are listed 'Best First'.
Re^4: data structure question
by SuicideJunkie (Vicar) on Aug 30, 2013 at 15:23 UTC

    The substructures are just unblessed object references to keep it simple. :)

    I'm not sure what you mean by worrying about the key names or location of the substructure... each portion of the code concerns itself with one layer and knows where it keeps its own things. The mapview has a 2d hash with ships in it, and doesn't care about the details. The shipview has a ship ref with components in it, and doesn't worry about the details. The aim screen has a single component ref and is at the bottom level of detail (its also stacked on top of a mapview so you can see what you're aiming at).

    Its not an *enforced* separation, but I like the straps on my straightjackets to be loose :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1051647]
and one hand claps...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2018-06-23 11:25 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.