Worms -- OOP Redo  2016-01
Worms-Redo Project as a learning vehicle.
Macros | Variables
worm.cpp File Reference
#include "worm.hpp"
Include dependency graph for worm.cpp:

Go to the source code of this file.

Macros

#define headSeg(wp)   (wp->body + wp->nsegs)
 
#define xOf(wp)   (headSeg(wp)->x)
 
#define yOf(wp)   (headSeg(wp)->y)
 

Variables

const int dxa [] = { +0, +1, +1, +1, +0, -1, -1, -1 }
 
const int dya [] = { -1, -1, +0, +1, +1, +1, +0, -1 }
 
const int nextTurn [16]
 
int victimSegNum
 
WormvictimWormp
 

Macro Definition Documentation

#define headSeg (   wp)    (wp->body + wp->nsegs)
#define xOf (   wp)    (headSeg(wp)->x)

Definition at line 7 of file worm.cpp.

Referenced by Worm::eatACarrot(), and Worm::setVictimWorm().

#define yOf (   wp)    (headSeg(wp)->y)

Definition at line 8 of file worm.cpp.

Referenced by Worm::eatACarrot(), and Worm::setVictimWorm().

Variable Documentation

const int dxa[] = { +0, +1, +1, +1, +0, -1, -1, -1 }

Definition at line 172 of file worm.cpp.

Referenced by Worm::live().

const int dya[] = { -1, -1, +0, +1, +1, +1, +0, -1 }

Definition at line 173 of file worm.cpp.

Referenced by Worm::live().

const int nextTurn[16]
Initial value:
= {
0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 7, 7, 7, 2, 6
}

Definition at line 175 of file worm.cpp.

Referenced by Worm::live().

int victimSegNum

Definition at line 88 of file worm.cpp.

Referenced by Worm::eat(), and Worm::setVictimWorm().

Worm* victimWormp

Definition at line 87 of file worm.cpp.