for(var/i in usr)
world<<"I'm in the user's contents"
Kind of like how usr automatically refers to CONTENTS.
And also would it be possible to do something like:
src += i
or... is this just not possible because the mob case is because of DM's syntax?
ID:156118
Dec 23 2010, 4:12 pm
|
|
Is there a way I can make a type be treated like a list (kind of like you can a mob) for instance:
for(var/i in usr) Kind of like how usr automatically refers to CONTENTS. And also would it be possible to do something like: src += i or... is this just not possible because the mob case is because of DM's syntax? |
In response to Jacksanto
|
|
It's not an atom.
|
You can give the datum a list variable (call it contents if you wish) and query datum.contents. It's a little extra typing but it's what you have to do.
Something like Container and then you'd just have to use for(var/i in instanceOfContainer.contents) |
In response to Jamckell
|
|
If it's not an atom, then it would of been useful for you to of said in the main post.
That aside, datums can just as easily have lists attatched to them as atoms can. //Defining and adding the list 'Contents' |
All atoms have contents, and atom is the ancestor of all mapable objects. So, As long as the type you want is mapable, you can always say
and be assured that as long as 'x' is mapable, it will have the possibility of contents. Does this help you?