Worms -- OOP Redo  2016-01
Worms-Redo Project as a learning vehicle.
Classes | Macros | Functions | Variables
worm.hpp File Reference
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
Include dependency graph for worm.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ASOG
 
struct  Worm::SEGMENT
 
class  Worm
 
class  WormInfo
 

Macros

#define asog(ptr, row, col)   (ptr + row*asogCols + col)
 
#define CARROT   '.'
 
#define COLOR_PAIR(x)   (x)
 
#define ESC   '\033'
 
#define isDigit(x)   ('0' <= x && x <= '9')
 
#define MAXsegs   100
 
#define min(a, b)   ((a) < (b)? (a) : (b))
 
#define NORTH   00
 
#define random(x)   (rand() % x)
 

Functions

WormfindSlot ()
 

Variables

int asogCols
 
int asogRows
 
int hxWorms
 
WormInfo worm_info []
 
Worm wormArray []
 
int xworms []
 

Macro Definition Documentation

#define asog (   ptr,
  row,
  col 
)    (ptr + row*asogCols + col)

Definition at line 16 of file worm.hpp.

#define CARROT   '.'

Definition at line 14 of file worm.hpp.

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

#define COLOR_PAIR (   x)    (x)

Definition at line 69 of file worm.hpp.

#define ESC   '\033'

Definition at line 13 of file worm.hpp.

Referenced by userControl().

#define isDigit (   x)    ('0' <= x && x <= '9')

Definition at line 11 of file worm.hpp.

#define MAXsegs   100

Definition at line 17 of file worm.hpp.

Referenced by Worm::createWorm().

#define min (   a,
 
)    ((a) < (b)? (a) : (b))

Definition at line 12 of file worm.hpp.

Referenced by Worm::createWorm(), and userKeyPress().

#define NORTH   00

Definition at line 15 of file worm.hpp.

#define random (   x)    (rand() % x)

Definition at line 10 of file worm.hpp.

Referenced by Worm::createWorm(), Worm::live(), and userKeyPress().

Function Documentation

Worm* findSlot ( )

Variable Documentation

int asogCols

Definition at line 18 of file display.cpp.

Referenced by Worm::createWorm(), Worm::live(), showScreen(), and startCurses().

int asogRows
int hxWorms
WormInfo worm_info[]
Initial value:
= {
{COLOR_PAIR(1), 3, 3},
{COLOR_PAIR(2), 4, 5},
{COLOR_PAIR(3), 5, 4}
}
#define COLOR_PAIR(x)
Definition: worm.hpp:69

Definition at line 71 of file worm.hpp.

Referenced by Worm::createWorm(), Worm::eat(), Worm::isHungry(), showOneWorm(), and Worm::showOneWorm().

Worm wormArray[]

Referenced by Worm::setVictimWorm().

int xworms[]