summaryrefslogtreecommitdiff
path: root/src/arena.c
blob: 52044d1335e4872e7494c5a1f1d1ea6ef1d2abfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

#include <stdlib.h>
#include <assert.h>
#include <string.h>

#include "arena.h"
#include "list.h"
#include "tux.h"
#include "shot.h"
#include "wall.h"
#include "item.h"

arena_t* newArena()
{
	arena_t *new;
	new = malloc( sizeof(arena_t) );
	
#ifndef BUBLIC_SERVER
	new->background = NULL;
	strcpy(new->music, "");
#endif

	new->listTux = newList();
	new->listShot = newList();
	new->listWall = newList();
	new->listItem = newList();
	new->listTeleport = newList();
	new->listPipe = newList();

	return new;
}

void destroyArena(arena_t *p)
{
	destroyListItem(p->listTux, destroyTux);
	destroyListItem(p->listShot, destroyShot);
	destroyListItem(p->listWall, destroyWall);
	destroyListItem(p->listItem, destroyItem);
	destroyListItem(p->listTeleport, destroyItem);
	destroyListItem(p->listPipe, destroyItem);

	free(p);
}