Set Up Adding to and Removing from Spaces

So in the interim since I posted last I realized that even if I went to the trouble of coming up with the math to test for space, it would be too complex in general, and especially if I ported this to JavaScript or PHP.

To simplify things I’m going to stick with volume for the Spaces. In order to be moved into a space, a Thing can’t have more volume than the remaining empty volume in the space. I’ll test scalar properties when passing through an exit, rather than being added to a space.

I’m suddenly wondering if it’s good coding practice to have a class with a member typed as a subclass of itself.

*work work work work work* Okey dokey now I’ve got addToContents and removeFromContents, so a Thing can be moved into a Space and out of a Space.

I guess that’s the Space class done, untill I figure out something else it needs. Still remaining are Mobile and Exit.

I didn’t do much today but I think I need to wrap it up, I’m just not feeling right, but I wanted to at least do something.

Tagged , , ,

One thought on “Set Up Adding to and Removing from Spaces

  1. Sebkha says:

    “I’m suddenly wondering if it’s good coding practice to have a class with a member typed as a subclass of itself.”

    Human has .mother of type Woman

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.