Home | History | Annotate | Download | only in monop

Lines Matching defs:attribute

69 static int restore_toplevel_attr(const char *attribute, char *txt);
70 static int restore_player_attr(const char *attribute, char *txt);
71 static int restore_deck_attr(const char *attribute, char *txt);
72 static int restore_square_attr(const char *attribute, char *txt);
461 char *attribute;
487 /* Any other line must begin with a word, which is the attribute. */
491 attribute = s;
492 s = strchr(attribute, ' ');
494 printf("file is corrupt: attribute %s lacks value.\n",
495 attribute);
507 return restore_toplevel_attr(attribute, txt);
511 return restore_player_attr(attribute, txt);
515 return restore_deck_attr(attribute, txt);
519 return restore_square_attr(attribute, txt);
527 restore_toplevel_attr(const char *attribute, char *txt)
529 if (!strcmp(attribute, "time")) {
531 } else if (!strcmp(attribute, "numplayers")) {
543 } else if (!strcmp(attribute, "currentplayer")) {
552 } else if (!strcmp(attribute, "doubles")) {
556 } else if (!strcmp(attribute, "player")) {
562 } else if (!strcmp(attribute, "deck")) {
568 } else if (!strcmp(attribute, "square")) {
575 printf("unknown attribute %s\n", attribute);
582 restore_player_attr(const char *attribute, char *txt)
593 if (!strcmp(attribute, "name")) {
606 } else if (!strcmp(attribute, "money")) {
607 if (getnum(attribute, txt, 0, INT_MAX, &pp->money) < 0) {
610 } else if (!strcmp(attribute, "loc")) {
612 if (getnum(attribute, txt, 0, N_SQRS, &tmp) < 0) {
616 } else if (!strcmp(attribute, "num_gojf")) {
617 if (getnum(attribute, txt, 0, 2, &tmp) < 0) {
621 } else if (!strcmp(attribute, "in_jail")) {
622 if (getnum(attribute, txt, 0, 3, &tmp) < 0) {
631 printf("unknown attribute %s\n", attribute);
638 restore_deck_attr(const char *attribute, char *txt)
646 if (!strcmp(attribute, "numcards")) {
647 if (getnum(attribute, txt, dp->num_cards, dp->num_cards,
651 } else if (!strcmp(attribute, "topcard")) {
652 if (getnum(attribute, txt, 0, dp->num_cards,
656 } else if (!strcmp(attribute, "gojf_used")) {
657 if (getnum(attribute, txt, 0, 1, &tmp) < 0) {
661 } else if (!strcmp(attribute, "cards")) {
677 printf("unknown attribute %s\n", attribute);
684 restore_square_attr(const char *attribute, char *txt)
689 if (!strcmp(attribute, "owner")) {
690 if (getnum(attribute, txt, -1, num_play-1, &tmp) < 0) {
696 } else if (!strcmp(attribute, "morg")) {
701 if (getnum(attribute, txt, 0, 1, &tmp) < 0) {
705 } else if (!strcmp(attribute, "houses")) {
710 if (getnum(attribute, txt, 0, 5, &tmp) < 0) {
715 printf("unknown attribute %s\n", attribute);