map.c
author viric@llimona
Sat, 06 May 2006 00:34:04 +0200
changeset 6 bfbca2c0fc70
parent 4 d9259a605dec
child 8 b41a580b3abe
permissions -rw-r--r--
More file separation.

#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include "general.h"

void CopyMap (struct Map *Mdest, const struct Map *Morig)
{
	memcpy((void *) Mdest, (void *) Morig, sizeof (struct Map));
}

int are_boxes_equal(const struct Position b1[], const struct Position b2[],
	int n)
{
	int i;
	char tmp[MAX_Y][MAX_X]; /* !!!argh */

	memset(tmp, 0, sizeof(tmp));

	for (i=0; i < n; i++)
	{
		tmp[b1[i].y][b1[i].x] = 1;
	}
	for (i=0; i < n; i++)
	{
		if (tmp[b2[i].y][b2[i].x] != 1)
			return FALSE;
	}
	return TRUE;
}