forked from Sanerres/vgstation13
-
Notifications
You must be signed in to change notification settings - Fork 0
/
topic_input.dm
60 lines (47 loc) · 1.08 KB
/
topic_input.dm
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/datum/topic_input
var/href
var/list/href_list
New(thref,list/thref_list)
href = thref
href_list = thref_list.Copy()
return
proc/get(i)
return listgetindex(href_list,i)
proc/getAndLocate(i)
var/t = get(i)
if(t)
t = locate(t)
return t || null
proc/getNum(i)
var/t = get(i)
if(t)
t = text2num(t)
return isnum(t) ? t : null
proc/getObj(i)
var/t = getAndLocate(i)
return isobj(t) ? t : null
proc/getMob(i)
var/t = getAndLocate(i)
return ismob(t) ? t : null
proc/getTurf(i)
var/t = getAndLocate(i)
return isturf(t) ? t : null
proc/getAtom(i)
return getType(i,/atom)
proc/getArea(i)
var/t = getAndLocate(i)
return isarea(t) ? t : null
proc/getStr(i)//params should always be text, but...
var/t = get(i)
return istext(t) ? t : null
proc/getType(i,type)
var/t = getAndLocate(i)
return istype(t,type) ? t : null
proc/getPath(i)
var/t = get(i)
if(t)
t = text2path(t)
return ispath(t) ? t : null
proc/getList(i)
var/t = getAndLocate(i)
return islist(t) ? t : null