+#---------- vessel properties ----------
+
+proc vesselclasses-init {} {
+ global vc_game2code vc_code2abbrev vc_abbrev2full
+ foreach {game code abbrev full} {
+ smsloop am sl Sloop
+ lgsloop bm ct Cutter
+ dhow cm dh Dhow
+ longship dm ls Longship
+ baghlah em bg Baghlah
+ merchbrig fm mb {Merchant Brig}
+ warbrig gm wb {War Brig}
+ xebec hm xe Xebec
+ warfrig im wf {War Frigate}
+ merchgal jm mg {Merchant Galleon}
+ grandfrig km gf {Grand Frigate}
+ } {
+ set vc_game2code($game) $code
+ set vc_code2abbrev($code) $abbrev
+ set vc_abbrev2full($abbrev) $full
+ }
+}
+
+proc code2abbrev {code} {
+ global vc_code2abbrev
+
+ manyset [split $code _] inport class subclass lockown xabbrev
+ manyset [split $lockown ""] lock own
+
+ set abbrev {}
+ append abbrev [lindex {? {}} $inport]
+ append abbrev $vc_code2abbrev($class)
+ append abbrev $subclass
+ append abbrev [lindex {* + -} $lock]
+ append abbrev [lindex {- = ?} [regsub {\D} $own 2]]
+ append abbrev $xabbrev
+
+ debug "CODE2ABBREV $code $abbrev"
+ return $abbrev
+}
+