-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalias_init.c
45 lines (41 loc) · 1.86 KB
/
alias_init.c
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
44
45
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_itoa.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cobrecht <cobrecht@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2013/11/22 10:02:41 by cobrecht #+# #+# */
/* Updated: 2015/06/09 14:24:35 by cobrecht ### ########.fr */
/* */
/* ************************************************************************** */
#include "ncurses_shell.h"
static void load_alias(t_map *map_alias)
{
hash_put(map_alias, "map.size", "msz");
hash_put(map_alias, "tile.content", "bct");
hash_put(map_alias, "team.names", "tna");
hash_put(map_alias, "player.position", "ppo");
hash_put(map_alias, "player.level", "plv");
hash_put(map_alias, "player.inventory", "pin");
hash_put(map_alias, "time.get", "sgt");
hash_put(map_alias, "time.set", "sst");
}
static void load_commands(t_map *map_alias)
{
hash_put(map_alias, "msz", "map.size");
hash_put(map_alias, "bct", "tile.content");
hash_put(map_alias, "tna", "team.names");
hash_put(map_alias, "ppo", "player.position");
hash_put(map_alias, "plv", "player.level");
hash_put(map_alias, "pin", "player.inventory");
hash_put(map_alias, "sgt", "time.get");
hash_put(map_alias, "sst", "time.set");
}
void alias_init(t_map *map_alias, t_map *map_cmd)
{
hash_create_str_str(map_alias, 50);
hash_create_str_str(map_cmd, 50);
load_alias(map_alias);
load_commands(map_cmd);
}