VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "file556"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Public itemdata As String
Public itemlen As Integer
Public objs As Integer

Private objstrings(1 To 200) As String

Public Function objstring(ByVal num As Integer) As String
    objstring = objstrings(num)
End Function
Public Function setobjstring(ByVal num As Integer, ByVal s As String)
    objstrings(num) = s
End Function
Public Function objtype(ByVal num As Integer) As String

    Dim ItemType As Integer
    
    ItemType = num 'graphics.f559.obj(num).itemtype
    If ItemType >= 157 And ItemType < 165 Then
        objtype = "Food"
    ElseIf ItemType >= 70 And ItemType < 128 Then
        objtype = "Armor"
    ElseIf ItemType >= 24 And ItemType < 70 Then
        objtype = "Weapon"
    Else
        objtype = "Misc"
    End If
    
End Function
'text file containing all the names of objects


Public Sub read()
    Dim i, j As Integer
    
    s = ""
    j = 1
    For i = 1 To itemlen
        data = AscB(MidB(itemdata, i, 1))
        s = s + chr(data And &H7F)
        If data >= 128 Then
            objstrings(j) = s
            j = j + 1
            s = ""
        End If
    Next
    
    objs = j - 1
End Sub

Function write_byte(num As Byte)
    itemdata = itemdata + ChrB(num)
End Function

Public Sub update()
    
    Dim i, j As Integer
    Dim b As Byte
    Dim chr As String
    
    itemdata = ""
    For i = 1 To 200
        For j = 1 To (Len(objstrings(i)) - 1)
            b = AscB(Mid(objstrings(i), j, 1))
            write_byte b
        Next
        If Len(objstrings(i)) = 0 Then
            write_byte 128 'hack, write a 0 string with 0x80 bit set...
        Else
            
            chr = Mid(objstrings(i), Len(objstrings(i)), 1)
            b = AscB(chr)
            b = b And &H7F
            b = b + &H80
            write_byte b
        End If
    Next
        
    'graphics.setitemsize 557, LenB(itemdata)
    'graphics.setitemstr 557, itemdata
    graphics.setgitemsize 556, LenB(itemdata)
    graphics.setgitemdata 556, itemdata
End Sub
    
