diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-02 15:03:24 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-02 15:03:24 +1300 |
commit | cafdea3a29fe9eeae0bc7908ed2f6934ad699cb0 (patch) | |
tree | a61a9f281a776870e9622ad06a2d2b05f03e2bfa | |
parent | Move temporary doors structure into static array (diff) | |
download | texad-cafdea3a29fe9eeae0bc7908ed2f6934ad699cb0.tar.gz texad-cafdea3a29fe9eeae0bc7908ed2f6934ad699cb0.zip |
Rearrange declarations and definitions
-rw-r--r-- | texad.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -74,10 +74,16 @@ struct world *genesis(void) w = (struct world*) malloc(sizeof(struct world)); p = (struct player*) malloc(sizeof(struct player)); + r[0] = (struct room*) malloc(sizeof(struct room)); r[1] = (struct room*) malloc(sizeof(struct room)); r[2] = (struct room*) malloc(sizeof(struct room)); + d[0] = (struct door*) malloc(sizeof(struct door)); + d[1] = (struct door*) malloc(sizeof(struct door)); + d[2] = (struct door*) malloc(sizeof(struct door)); + d[3] = (struct door*) malloc(sizeof(struct door)); + r[0]->title = "The foo room"; r[0]->description = "You are in the foo room. Sunlight streams from the windows."; @@ -87,11 +93,6 @@ struct world *genesis(void) r[2]->title = "The baz room"; r[2]->description = "You are in the baz room. It is richly furnished."; - d[0] = (struct door*) malloc(sizeof(struct door)); - d[1] = (struct door*) malloc(sizeof(struct door)); - d[2] = (struct door*) malloc(sizeof(struct door)); - d[3] = (struct door*) malloc(sizeof(struct door)); - d[0]->direction = EAST; d[0]->src = r[0]; d[0]->dst = r[1]; |