-
Notifications
You must be signed in to change notification settings - Fork 2
/
bbtype.bmx
56 lines (41 loc) · 1.04 KB
/
bbtype.bmx
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
' BBType adds legacy Type functionality to BlitzMax Type
Type TBBType
Field _list:TList
Field _link:TLink
Method Add(t:TList)
_list=t
_link=_list.AddLast(self)
End Method
Method InsertBefore(t:TBBType)
_link.Remove
_link=_list.InsertBeforeLink(self,t._link)
End Method
Method InsertAfter(t:TBBType)
_link.Remove
_link=_list.InsertAfterLink(self,t._link)
End Method
Method Remove()
_list.remove self
End Method
End Type
Function DeleteLast(t:TBBType)
if t TBBType(t._list.Last()).Remove()
End Function
Function DeleteFirst(t:TBBType)
if t TBBType(t._list.First()).Remove()
End Function
Function DeleteEach(t:TBBType)
if t t._list.Clear()
End Function
Function ReadString$(in:TStream)
local length
length=readint(in)
if length>0 and length<1024*1024 return brl.stream.readstring(in,length)
End Function
Function HandleToObject:Object(obj:Object)
Return obj
End Function
Function HandleFromObject(obj:Object)
Local h=HandleToObject(obj)
Return h
End Function