56 lines
862 B
C
56 lines
862 B
C
#include "disp.h"
|
|
#include "entity.h"
|
|
|
|
static char *body_part_str(enum BodyPart body_part);
|
|
static char *species_str(enum Species species);
|
|
|
|
void
|
|
entity_print_desc(struct Entity entity)
|
|
{
|
|
int i;
|
|
|
|
i = -1;
|
|
while (++i < BODY_PARTS) {
|
|
disp_print(species_str(entity.body[i]));
|
|
disp_print(" ");
|
|
disp_print(body_part_str(i));
|
|
disp_print("\n");
|
|
}
|
|
}
|
|
|
|
static char *
|
|
body_part_str(enum BodyPart body_part)
|
|
{
|
|
switch (body_part) {
|
|
case HEAD:
|
|
return "head";
|
|
case BODY:
|
|
return "body";
|
|
case ARMS:
|
|
return "arms";
|
|
case LEGS:
|
|
return "legs";
|
|
default:
|
|
return "<unknown body part>";
|
|
}
|
|
}
|
|
|
|
static char *
|
|
species_str(enum Species species)
|
|
{
|
|
switch (species) {
|
|
case VOID:
|
|
return "no";
|
|
case HUMAN:
|
|
return "human";
|
|
case SPIDER:
|
|
return "spider";
|
|
case DUCK:
|
|
return "duck";
|
|
case BABOON:
|
|
return "baboon";
|
|
default:
|
|
return "<unknow species>";
|
|
}
|
|
}
|