]> git.pond.sub.org Git - empserver/commitdiff
edit: Generalize edit to multiple objects
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 29 Mar 2013 18:34:12 +0000 (19:34 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 6 Jun 2013 17:59:18 +0000 (19:59 +0200)
Accept general <SECTS|SHIPS|PLANES|LANDS|NATS> argument instead of
just <SECT|SHIP|PLANE|LAND|NAT>.

edit with <KEY> <VALUE>... arguments applies the arguments to all
selected objects.  Without such arguments, edit lets you edit the
selected objects interactively one after the other.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
info/edit.t
src/lib/commands/edit.c
src/lib/player/empmod.c
tests/actofgod/actofgod.xdump
tests/actofgod/geninput.pl
tests/actofgod/init_script
tests/actofgod/journal.log

index ec2784e505cc0111c19d8d3872cf49528931f424..51b427e6f0d1c8fab0a7b010b2a62ef1882a2504 100644 (file)
@@ -1,9 +1,13 @@
 .TH Command EDIT
-.NA edit "Edit country, sector, ship, plane or land unit"
+.NA edit "Edit sectors, ships, planes, land units or countries"
 .LV Expert
-.SY "edit <country|land|unit|ship|plane> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]..."
-The \*Qedit\*U command allows deities to edit properties of a country,
-sector (confusingly called <land> here), ship, plane or land unit.
+.SY "edit land <SECTS> [<KEY> <VALUE>]..."
+.SY "edit ship <SHIPS> [<KEY> <VALUE>]..."
+.SY "edit plane <PLANES> [<KEY> <VALUE>]..."
+.SY "edit unit <LANDS> [<KEY> <VALUE>]..."
+.SY "edit country <NATS> [<KEY> <VALUE>]..."
+The \*Qedit\*U command allows deities to edit properties of a sector
+(confusingly called <land> here), ship, plane, land unit, or country.
 .s1
 If you don't specify any <KEY> <VALUE> pair, \*Qedit\*U enters
 interactive mode.  Editable properties are shown together with their
index 7258bd0cafeb17d6120a77a58d7e9c8d003b7306..dacf508fc211820966ad67a61f4d004cfaf0629e 100644 (file)
@@ -65,134 +65,123 @@ edit(void)
 {
     union empobj_storage item;
     char *what;
+    struct nstr_item ni;
     char *key, *ptr;
-    int num;
-    int ret;
-    int arg_index = 3;
-    coord x, y;
     struct natstr *np;
+    int type, arg_index, ret;
     char buf[1024];
-    char ewhat;
 
     what = getstarg(player->argp[1],
                    "Edit what (country, land, ship, plane, nuke, unit)? ",
                    buf);
     if (!what)
        return RET_SYN;
-    ewhat = what[0];
-    switch (ewhat) {
+    switch (what[0]) {
     case 'l':
-       if (!(ptr = getstarg(player->argp[2], "Sector : ", buf)))
-           return RET_FAIL;
-       if (!sarg_xy(ptr, &x, &y))
-           return RET_FAIL;
-       if (!getsect(x, y, &item.sect))
-           return RET_FAIL;
-       break;
-    case 'c':
-       np = natargp(player->argp[2], "Country? ");
-       if (!np)
-           return RET_SYN;
-       item.nat = *np;
+       type = EF_SECTOR;
        break;
     case 'p':
-       if ((num = onearg(player->argp[2], "Plane number? ")) < 0)
-           return RET_SYN;
-       if (!getplane(num, &item.plane))
-           return RET_SYN;
+       type = EF_PLANE;
        break;
     case 's':
-       if ((num = onearg(player->argp[2], "Ship number? ")) < 0)
-           return RET_SYN;
-       if (!getship(num, &item.ship))
-           return RET_SYN;
+       type = EF_SHIP;
        break;
     case 'u':
-       if ((num = onearg(player->argp[2], "Unit number? ")) < 0)
-           return RET_SYN;
-       if (!getland(num, &item.land))
-           return RET_SYN;
+       type = EF_LAND;
        break;
     case 'n':
        pr("Not implemented yet.\n");
        return RET_FAIL;
+    case 'c':
+       type = EF_NATION;
+       break;
     default:
        pr("huh?\n");
        return RET_SYN;
     }
-    if (!player->argp[3]) {
-       switch (ewhat) {
-       case 'l':
-           print_sect(&item.sect);
-           break;
-       case 'c':
-           print_nat(np);
-           break;
-       case 'p':
-           print_plane(&item.plane);
-           break;
-       case 's':
-           print_ship(&item.ship);
-           break;
-       case 'u':
-           print_land(&item.land);
-           break;
-       default:
-           CANT_REACH();
+
+    if (!snxtitem(&ni, type, player->argp[2], NULL))
+       return RET_SYN;
+    while (nxtitem(&ni, &item)) {
+       if (!player->argp[3]) {
+           switch (type) {
+           case EF_SECTOR:
+               print_sect(&item.sect);
+               break;
+           case EF_SHIP:
+               print_ship(&item.ship);
+               break;
+           case EF_PLANE:
+               print_plane(&item.plane);
+               break;
+           case EF_LAND:
+               print_land(&item.land);
+               break;
+           case EF_NATION:
+               print_nat(&item.nat);
+               break;
+           default:
+               CANT_REACH();
+           }
        }
-    }
-    for (;;) {
-       if (player->argp[arg_index]) {
-           if (player->argp[arg_index+1]) {
-               key = player->argp[arg_index++];
-               ptr = player->argp[arg_index++];
+
+       arg_index = 3;
+       for (;;) {
+           if (player->argp[arg_index]) {
+               if (player->argp[arg_index+1]) {
+                   key = player->argp[arg_index++];
+                   ptr = player->argp[arg_index++];
+               } else
+                   return RET_SYN;
+           } else if (arg_index == 3) {
+               key = getin(buf, &ptr);
+               if (!key)
+                   return RET_SYN;
+               if (!*key)
+                   break;
            } else
-               return RET_SYN;
-       } else if (arg_index == 3) {
-           key = getin(buf, &ptr);
-           if (!key)
-               return RET_SYN;
-           if (!*key)
-               return RET_OK;
-       } else
-           return RET_OK;
+               break;
 
-       if (!check_obj_ok(&item.gen))
-           return RET_FAIL;
-       switch (ewhat) {
-       case 'c':
-           /*
-            * edit_nat() may update the edited country by sending it
-            * bulletins.  Writing back item.nat would trigger a seqno
-            * mismatch oops.  Workaround: edit in-place.
-            */
-           ret = edit_nat(np, key, ptr);
+           if (!check_obj_ok(&item.gen))
+               return RET_FAIL;
+           switch (type) {
+           case EF_NATION:
+               /*
+                * edit_nat() may update the edited country by sending
+                * it bulletins.  Writing back item.nat would trigger
+                * a seqno mismatch oops.  Workaround: edit in-place.
+                */
+               np = getnatp(item.nat.nat_cnum);
+               ret = edit_nat(np, key, ptr);
+               if (ret != RET_OK)
+                   return ret;
+               if (!putnat(np))
+                   return RET_FAIL;
+               item.nat = *np;
+               continue;
+           case EF_SECTOR:
+               ret = edit_sect(&item.sect, key, ptr);
+               break;
+           case EF_SHIP:
+               ret = edit_ship(&item.ship, key, ptr);
+               break;
+           case EF_LAND:
+               ret = edit_land(&item.land, key, ptr);
+               break;
+           case EF_PLANE:
+               ret = edit_plane(&item.plane, key, ptr);
+               break;
+           default:
+               CANT_REACH();
+           }
            if (ret != RET_OK)
                return ret;
-           if (!putnat(np))
+           if (!put_empobj(type, item.gen.uid, &item.gen))
                return RET_FAIL;
-           item.nat = *np;
-           continue;
-       case 'l':
-           ret = edit_sect(&item.sect, key, ptr);
-           break;
-       case 's':
-           ret = edit_ship(&item.ship, key, ptr);
-           break;
-       case 'u':
-           ret = edit_land(&item.land, key, ptr);
-           break;
-       case 'p':
-           ret = edit_plane(&item.plane, key, ptr);
-           break;
-       default:
-           CANT_REACH();
        }
-       if (ret != RET_OK)
-           return ret;
-       if (!put_empobj(item.gen.ef_type, item.gen.uid, &item.gen))
-           return RET_FAIL;
     }
+
+    return RET_OK;
 }
 
 static void
index 4f17df558e017c4216561573e171d9f63b2902cc..a01b34aad02ae874bb9518464b3b8519929c0c89 100644 (file)
@@ -99,7 +99,7 @@ struct cmndstr player_coms[] = {
      1, drop, C_MOD, NORM + MONEY + CAP},
     {"dump <SECTS> [<fields>]", 0, dump, 0, NORM},
     {"echo [<string>]", 0, echo, 0, 0},
-    {"edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...",
+    {"edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...",
      0, edit, C_MOD, GOD},
     {"enable", 0, enab, C_MOD, GOD},
     {"enlist <SECTS> <NUM>", 2, enli, C_MOD, NORM + MONEY + CAP},
index 93d90c2dfc563ae72dce5641781dd2046f5da468..24d8d48dbcafce6a7cf190cf0c163457aca3f74b 100644 (file)
@@ -63,8 +63,8 @@ owner xloc yloc des effic mobil off loyal terr0 terr1 terr2 terr3 dterr xdist yd
 1 1 5 4 0 1 0 0 0 0 0 0 0 1 5 1 0 100 1 4 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
 1 3 5 4 0 2 0 0 0 0 0 0 0 3 5 1 0 100 0 4 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
 1 5 5 4 0 0 0 0 0 0 0 0 0 5 5 0 0 100 0 4 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
-1 7 5 4 0 0 0 0 0 0 0 0 0 7 5 0 0 100 0 4 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
-1 9 5 4 0 0 0 0 0 0 0 0 0 9 5 0 0 100 0 4 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
+1 7 5 4 1 0 0 0 0 0 0 0 0 7 5 0 0 100 0 4 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
+1 9 5 4 2 0 0 0 0 0 0 0 0 9 5 0 0 100 0 4 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
 1 11 5 4 0 0 0 0 0 0 0 0 0 11 5 0 0 100 0 4 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
 2 -11 5 4 0 0 0 0 0 0 0 0 0 -11 5 0 0 100 0 4 0 0 0 0 0 2 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
 2 -9 5 4 0 0 0 0 0 0 0 0 0 -9 5 0 0 100 0 4 0 0 0 0 0 2 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
@@ -367,7 +367,7 @@ actor action victim times duration time
 0 44 1 32 0 0
 0 43 2 5 0 0
 0 44 3 19 0 0
-0 43 1 71 0 0
+0 43 1 73 0 0
 0 42 1 4 0 0
 1 45 0 1 0 0
 0 43 3 30 0 0
index 05755f243f7d73990439193648ea18b9c567312a..2620c0fbd421b327d4b4bbd0afc5673e282b8054 100755 (executable)
@@ -205,9 +205,8 @@ edit('sect', '4,4', 'D', '4,4');
 
 # des newdes
 for my $key ('s', 'S') {
+    edit('sect', '6:8,4', $key, '+');
     edit('sect', '6,4', $key, '+');
-    edit('sect', '6,4', $key, '+');
-    edit('sect', '8,4', $key, '+');
     edit('sect', '8,4', $key, ',');
 }
 
@@ -217,6 +216,7 @@ edit('sect', '1,5', 'm', 1, 'a', 1);
 # interactive edit
 iedit('sect', '3,5', 'm 2', 'a 1');
 iedit('sect', '5,5', ' ');
+iedit('sect', '7:9,5', 'e 1', '', 'e 2');
 
 # give
 give('2,6', 'l', $INT_MIN);
index fa5ba82ff49ab34504f733915b13768cc2b57787..8b4ed96a5750c6d8c5af1f9b855ccb949c8043fa 100644 (file)
@@ -29,8 +29,4 @@ buil p 1,-1 f1 5 100
 des 1,-1 !
 buil l 1,-1 sup 5 100
 edit l 3,-1 L 1,-1
-edit c 1 t 0 s 4
-edit c 2 t 0 s 4
-edit c 3 t 0 s 4
-edit c 4 t 0 s 4
-edit c 5 t 0 s 4
+edit c 1/2/3/4/5 t 0 s 4
index f6de7309708672a75afa80e23ef56c1efff5f898..15f848d8f551958f2b4408b297b40f7d0e162218 100644 (file)
@@ -20,7 +20,7 @@
     Play#0 input edit l 0,0 @ 0
     Play#0 command edit
     Play#0 output Play#0 1 huh? (@)
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input setres @ 0,0 0
     Play#0 command setresource
@@ -43,7 +43,7 @@
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 1,7 o -1
     Play#0 command edit
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 3,7 o 98
     Play#0 command edit
@@ -51,7 +51,7 @@
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 3,7 o 99
     Play#0 command edit
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 1,7 O 0
     Play#0 command edit
@@ -59,7 +59,7 @@
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 1,7 O -1
     Play#0 command edit
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 3,7 O 98
     Play#0 command edit
@@ -67,7 +67,7 @@
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 3,7 O 99
     Play#0 command edit
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 1,7 X 0
     Play#0 command edit
@@ -75,7 +75,7 @@
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 1,7 X -1
     Play#0 command edit
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 3,7 X 98
     Play#0 command edit
@@ -83,7 +83,7 @@
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 3,7 X 99
     Play#0 command edit
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 5,7 o 2
     Play#0 command edit
     Play#0 input edit l 3,-7 L 3,-7 L 1,0
     Play#0 command edit
     Play#0 output Play#0 1 Sector 3,-7 unchanged
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 1,1 e 0
     Play#0 command edit
     Play#0 command edit
     Play#0 output Play#0 1 Distribution sector of 4,4 unchanged
     Play#0 output Play#0 6 0 640
-    Play#0 input edit l 6,4 s +
+    Play#0 input edit l 6:8,4 s +
     Play#0 command edit
     Play#0 output Play#0 1 Designation of 6,4 changed from - to +
+    Play#0 output Play#0 1 Designation of 8,4 changed from - to +
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 6,4 s +
     Play#0 command edit
     Play#0 output Play#0 1 Designation of 6,4 unchanged
     Play#0 output Play#0 6 0 640
-    Play#0 input edit l 8,4 s +
-    Play#0 command edit
-    Play#0 output Play#0 1 Designation of 8,4 changed from - to +
-    Play#0 output Play#0 6 0 640
     Play#0 input edit l 8,4 s ,
     Play#0 command edit
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
-    Play#0 input edit l 6,4 S +
+    Play#0 input edit l 6:8,4 S +
     Play#0 command edit
     Play#0 output Play#0 1 New designation of 6,4 changed from - to +
+    Play#0 output Play#0 1 New designation of 8,4 changed from - to +
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 6,4 S +
     Play#0 command edit
     Play#0 output Play#0 1 New designation of 6,4 unchanged
     Play#0 output Play#0 6 0 640
-    Play#0 input edit l 8,4 S +
-    Play#0 command edit
-    Play#0 output Play#0 1 New designation of 8,4 changed from - to +
-    Play#0 output Play#0 6 0 640
     Play#0 input edit l 8,4 S ,
     Play#0 command edit
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 1,5 m 1 a 1
     Play#0 command edit
     Play#0 output Play#0 6 0 640
     Play#0 input 
     Play#0 output Play#0 6 0 640
+    Play#0 input edit l 7:9,5
+    Play#0 command edit
+    Play#0 output Play#0 1 Location <L>: 7,5   Distribution sector <D>: 7,5
+    Play#0 output Play#0 1 Designation <s>: -  New designation <S>: -
+    Play#0 output Play#0 1 own  oo eff mob min gld frt oil urn wrk lty che ctg plg ptime fall avail
+    Play#0 output Play#0 1   o   O   e   m   i   g   f   c   u   w   l   x   X   p     t    F     a
+    Play#0 output Play#0 1   1   1   0   0   0   0   0   0   0 100   0   0   0   0     0    0     0
+    Play#0 output Play#0 1 Mines <M>: 0
+    Play#0 output Play#0 1 Road % <R>: 0       Rail % <r>: 0   Defense % <d>: 0
+    Play#0 output Play#0 4 %c xxxxx -- thing value : 
+    Play#0 input e 1
+    Play#0 output Play#0 1 Efficiency of 7,5 changed from 0 to 1
+    Play#0 output Play#0 4 %c xxxxx -- thing value : 
+    Play#0 input 
+    Play#0 output Play#0 1 Location <L>: 9,5   Distribution sector <D>: 9,5
+    Play#0 output Play#0 1 Designation <s>: -  New designation <S>: -
+    Play#0 output Play#0 1 own  oo eff mob min gld frt oil urn wrk lty che ctg plg ptime fall avail
+    Play#0 output Play#0 1   o   O   e   m   i   g   f   c   u   w   l   x   X   p     t    F     a
+    Play#0 output Play#0 1   1   1   0   0   0   0   0   0   0 100   0   0   0   0     0    0     0
+    Play#0 output Play#0 1 Mines <M>: 0
+    Play#0 output Play#0 1 Road % <R>: 0       Rail % <r>: 0   Defense % <d>: 0
+    Play#0 output Play#0 4 %c xxxxx -- thing value : 
+    Play#0 input e 2
+    Play#0 output Play#0 1 Efficiency of 9,5 changed from 0 to 2
+    Play#0 output Play#0 4 %c xxxxx -- thing value : 
+    Play#0 input 
+    Play#0 output Play#0 6 0 640
     Play#0 input give l 2,6 -2147483648
     Play#0 command give
     Play#0 output Play#0 1 Only 0 given in 2,6
     Play#0 output Play#0 6 0 640
     Play#0 input edit s 0 O -1
     Play#0 command edit
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit s 1 O 98
     Play#0 command edit
     Play#0 output Play#0 6 0 640
     Play#0 input edit s 1 O 99
     Play#0 command edit
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit s 2 O 2
     Play#0 command edit
     Play#0 input edit s 0 U 0 U -1
     Play#0 command edit
     Play#0 output Play#0 1 cs   cargo ship (#0) unchanged
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit s 2 L 3,-1
     Play#0 command edit
     Play#0 output Play#0 6 0 640
     Play#0 input edit p 0 O -1
     Play#0 command edit
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit p 1 O 98
     Play#0 command edit
     Play#0 output Play#0 6 0 640
     Play#0 input edit p 1 O 99
     Play#0 command edit
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit p 2 O 2
     Play#0 command edit
     Play#0 input edit p 0 U 0 U -1
     Play#0 command edit
     Play#0 output Play#0 1 f1   Sopwith Camel #0 unchanged
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit p 2 l 3,-1
     Play#0 command edit
     Play#0 output Play#0 6 0 640
     Play#0 input edit u 0 O -1
     Play#0 command edit
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit u 1 O 98
     Play#0 command edit
     Play#0 output Play#0 6 0 640
     Play#0 input edit u 1 O 99
     Play#0 command edit
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit u 2 O 2
     Play#0 command edit
     Play#0 input edit u 0 U 0 U -1
     Play#0 command edit
     Play#0 output Play#0 1 sup  supply #0 unchanged
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit u 2 L 3,-1
     Play#0 command edit
     Play#0 input edit p 2 s -1 s 9999
     Play#0 command edit
     Play#0 output Play#0 1 Ship of f1   Sopwith Camel #2 unchanged
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit p 3 s 3
     Play#0 command edit
     Play#0 input edit u 2 S -1 S 9999
     Play#0 command edit
     Play#0 output Play#0 1 Ship of sup  supply #2 unchanged
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit u 3 S 3
     Play#0 command edit
     Play#0 input edit c 1 n POGO
     Play#0 command edit
     Play#0 output Play#0 1 Country #0 is already called `POGO'
-    Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
+    Play#0 output Play#0 1 Usage: edit <l|s|p|u|c> <SECTS|SHIPS|PLANES|LANDS|NATS> [<KEY> <VALUE>]...
     Play#0 output Play#0 6 0 640
     Play#0 input edit c 2 n 2
     Play#0 command edit
     Play#0 output Play#0 1 Available workforce of 1,5 changed from 0 to 1 by an act of POGO
     Play#0 output Play#0 1 Mobility of 3,5 changed from 0 to 2 by an act of POGO
     Play#0 output Play#0 1 Available workforce of 3,5 changed from 0 to 1 by an act of POGO
+    Play#0 output Play#0 1 Efficiency of 7,5 changed from 0 to 1 by an act of POGO
+    Play#0 output Play#0 1 Efficiency of 9,5 changed from 0 to 2 by an act of POGO
     Play#0 output Play#0 1 POGO gave you 1 civilians in 4,6
     Play#0 output Play#0 1 POGO gave you 1 civilians in 6,6
     Play#0 output Play#0 1 POGO gave you 1 civilians in 8,6