summaryrefslogtreecommitdiff
path: root/inc/commands.h
blob: b48b28c4d41a9e3e966f1f59e87656d044f2f6be (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
#ifndef COMMANDS_H
#define COMMANDS_H

#include "demo.h"

typedef struct
{
    char cmdtype;
    char settype;
    int id;
    char from[24];
    char to[24];
} cmdinput;

int setnamebyid(int id, char *newname, demo *demo);
int setnamebyname(char *oldname, char *newname, demo *demo);

int setskinbyid(int id, char *skin, demo *demo);
int setskinbyname(char *name, char *skin, demo *demo);

/* Changes demos map to given map */
/* Changes demo version to 5 if it is 6 */
/* Will fail if mapname >= 31, or map is not a teeworlds datafile */
int changemap(FILE *map, char *mapname, demo *demo);

/* Writes the map in demo to out */
int exportmap(FILE *out, demo *demo);

void runcommand(cmdinput *cmd, demo *demo);

#endif // COMMANDS_H