Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Stylistic Question

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey All -

Re-creating a class in my MUD, and looking for stylistic suggestions and general feedback on my code before I convert ~30 legacy children. The class is called ActionEvent, and essentially represents any kind of action - such as an attack - in the game. ActionEvent objects deal with action mechanics (which sometimes contain sub-events, IE component ActionEvents) and narratives.

Here's one child I have converted so far:


...and component class RoundTimeEvent...


PS - Apologies for the screen widening effect, wanted to convey exactly how it's coded. Most sincere thanks in advance!
 
Marshal
Posts: 79632
380
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Alex Birmingham wrote:. . . Apologies for the screen widening effect . . . Most sincere thanks in advance!

Apologies accepted

But it is good style to put line breaks (and additional indentation) in such long lines.
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One really quick thing, you seem to have some repeated strings in the code. Also, if you want your MUD to be international then you're going to have to thing about externalising those strings

Some javadoc might also assist other developers as to what's going on (although most of it is pretty clear), I think the thirdPersons bit could do with a comment as to 'what' they are.

Can't really comment on the architecture, but it looks like you're queuing up events and narratives, seems like a reasonable thing to do, as long as thos data structures don't get corrupted (I assume this is all multithreaded...)
 
reply
    Bookmark Topic Watch Topic
  • New Topic