Up to Main Index                          Up to Journal for February, 2016

                   JOURNAL FOR SATURDAY 27TH FEBRUARY, 2016
______________________________________________________________________________

SUBJECT: 'has' package and other random updates
   DATE: Sat 27 Feb 10:42:30 GMT 2016

What a gloriously crap week it has been! Good excuse to bury myself in WolfMUD
and forget about the real world for a while.

I've been working on a few different bits and pieces which I'm currently
pushing out to the public dev branch.

The biggest update is one that has been long overdue. I've finally split up
all of the interface in has/common.go into their own files and documented the
whole lot. Took quite a while but was worth it. Even found a few rough corners
that I fixed which makes up most of the rest of the changes for this push.

Exits have been cleaned up so that all methods consistently use a direction
instead of mixing directions and names. Using direction which is an int is a
much better idea than using a string when matching. For example the direction
3 has the name 'southeast'. To convert from a name to a direction the
Exits.NormalizeDirection method can be used. To convert the other way, from a
direction to a name, there is a new Exits.ToName method.

A subtle data race in comms.Client has been fixed. The bug was in some
temporary code that will be dropped once player accounts are added. But data
races are bad, so I fixed it.

The Inventory interface has been tweaked. Inventory.Count has been replaced
with Inventory.Empty so that the interface is a little more general and not so
dependant on the default attr.Inventory implementation.

The Found method, which checks a typed nil for an interface instead of just a
plain nil[1], has been extended to all attributes. Instead of having Found in
a few attributes Found is now part of the has.Attribute interface and must be
implemented by all Attribute types.

For this update that's all of the highlights.

One thing I keep forgetting to mention is that I'm now using Go 1.6 which was
released on the 17th February.

Now I need to decide what to work on next. I'm guessing adding file handling
makes the most sense. I can start with the reading and loading side first and
use it for the configuration settings. Then I can extend it to handle world
zone files so people can build things just by editing text files. Then I can
add writing so that it can handle reading and writing of player accounts.

Sounds like I have a plan :)

--
Diddymus

  [1] See also: ../../../journal/2016/1/31.html


  Up to Main Index                          Up to Journal for February, 2016