Up to Main Index                          Up to Journal for February, 2015

                   JOURNAL FOR TUESDAY 17TH FEBRUARY, 2015
______________________________________________________________________________

SUBJECT: A little information on commands
   DATE: Tue 17 Feb 21:16:39 GMT 2015

I know I said I was going to try and make more journal entries. I also know I
haven't - mainly due to real life taking over and getting real busy. On the
plus side I have had some hardware parts donated so that I can rebuild my
server - just haven't had any time to do so yet :(

In the mean time, at a keyboard just in front of me...

I managed to do some more work on WolfMUD-mini. I currently have movement
working, GET and DROP, PUT and TAKE (for containers), INVENTORY, EXAMINE, LOOK
and READ. Those are the commands I've been concentrating on for now as they
provide a lot of the main types of interaction with objects that are going to
be needed.

Each of the commands are self contained. For example there is a get.go and a
drop.go - this should make it easier to add new commands, especially for other
people besides myself. Each command looks at what an object is capable of
depending on the interfaces it implements. So if an object can do 'this' and
'this' we can use 'this' command on it. This plays to one of Go's strengths
and uses type assertions quite heavily. It doesn't use reflection[1].

As an example I'll take something easy - the READ command. If an item has a
writing attribute it can be read. As attributes can be added and removed
dynamically it makes it easy to implement a WRITE command - although I haven't
done that just yet.

One interesting change that has happened - locations have disappeared. Well
not disappeared but there is no specific location type. You can go anywhere
there is an inventory for you to 'enter' - before locations were anything with
exit attributes. I think this will open up some interesting possibilities.

--
Diddymus

  [1] Actually some original iterations did use reflection - but I was shown
      the error of my ways.


  Up to Main Index                          Up to Journal for February, 2015