functions.h File Reference

#include "cell.h"
Include dependency graph for functions.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  directions
 Struct for storing directions. More...

Functions

float len (int x, int y, int x2, int y2)
 Distance between 2 points.
int numof_free_states (int x, int y, struct cell *level, int scale)
 Number of free cells around specified spot.
struct directions findfree (int x, int y, struct cell *level, struct cell *cells, int num, int scale)
 Finds free (available to step onto) directions for specified spot.
int comparecell (struct cell c1, struct cell c2)
 Compares two cells.
int isempty (struct cell *level, int x, int y, int x2, int y2, int scale)
int isclean (struct cell *level, int x, int y, int x2, int y2, int scale)
int createstairs (struct cell *level, int size, int direction)
int calculatedmg (int n, int m, int l)
char * strwhatis (struct cell c)

Function Documentation

int calculatedmg ( int  n,
int  m,
int  l 
)
int comparecell ( struct cell  c1,
struct cell  c2 
)

Compares two cells.

Returns:
1 if cells is equal, 0 otherwise
int createstairs ( struct cell level,
int  size,
int  direction 
)
struct directions findfree ( int  x,
int  y,
struct cell level,
struct cell cells,
int  num,
int  scale 
) [read]

Finds free (available to step onto) directions for specified spot.

Warning: this is low-level function. Try do not use it somewhere in step.c

Parameters:
(x,y) - Coordinates of spot
level - See above
cells - Container of cells considered non-free to pass through
scale - See above
Returns:
struct directions. Value of directions considered free is non-zero, zero othewise

Here is the call graph for this function:

int isclean ( struct cell level,
int  x,
int  y,
int  x2,
int  y2,
int  scale 
)
int isempty ( struct cell level,
int  x,
int  y,
int  x2,
int  y2,
int  scale 
)
float len ( int  x,
int  y,
int  x2,
int  y2 
)

Distance between 2 points.

Returns:
sqrt((x2-x)^2+(y2-y)^2). Just a formula from school
int numof_free_states ( int  x,
int  y,
struct cell level,
int  scale 
)

Number of free cells around specified spot.

Parameters:
(x,y) - Coordinates
level - Container of cells
scale - Number of columns in the field of the game

Here is the call graph for this function:

char* strwhatis ( struct cell  c  ) 
Generated on Mon Nov 15 10:26:47 2010 for Tales of Paraverse by  doxygen 1.6.3