Re: [ADMIN][Win95] Circle Mud translated in C++

From: Mo McKinlay (M.McKinlay@BEKON.COM)
Date: 11/03/98


> It's possible ("make CC=g++" works.)
>
> It's a lot of changes to do and I know one of the Chris' around here has
> done it.  General consensus is to not do it unless you really know C++.
> Otherwise, a MUD is ideally suited for it in many ways.

I co-wrote a MUD based on Circle, which then turned into a MUD/Talker
(alas currently between servers), which included a lot of C++ code in it -
gcc will actually compile using g++ if you specify a .cpp extension on the
files, ao you don't need to change the make options.

I found another advantage to writing in C++ as opposed to ANSI C - Emacs'
C++ mode is nicer than it's default C mode, and I couldn't be bothered to
go through each file adding a /* -*- C++ -*- */ at the top :)

In short, C++ and C code will happily co-exist in CircleMUD, just ensure
you declare your externs properly (e.g. extern "C") if some modules are
compiled with gcc and some with g++. It's probably best not to re-write
various chunks in C++, as it'll have a speed impact in some cases (like
the communications stuff), although there are definite advantages to
having a Player or Char class that has command methods, instead of a bunch
of structs - you could start with a base Char class, and sub-class it for
MOB and Player, and if you wanted to be really smart, sub-class Player to
God, GrGod and Implementor, each with thier own command-sets.

Just a thought...

Mo.

--
Mo McKinlay
Development and Support Manager
IDSS Department
Bekon
2 North Place
Stockport
Cheshire
SK1 1HH
T: +44 (0) 161 476 1300 x224
F: +44 (0) 161 476 1311
E: M.McKinlay@bekon.com
W: http://www.bekon.com/idss/

--
The contents of this electronic mail message should be considered
confidential unless specifically stated otherwise. This includes
both professional and personal mail.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST