I am having trouble defining the get/set for an array in a class I have created.... how do you get/set arrays within classes? basically I have an array with x and y as width/height for a map i am creating, and i want each x/y point to have the "walkable" and "image" properties, a boolean and path respectively. here is the code...
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.IO
Public Class Tile
Dim wlkable As Boolean
Dim imge As Path
Public Property walkable()
Get
Return wlkable
End Get
Set(ByVal value)
wlkable = value
End Set
End Property
Public Property image()
Get
Return imge
End Get
Set(ByVal value)
imge = value
End Set
End Property
End Class
Public Class Map
Inherits Tile
Dim named As String
Dim wdth As Integer
Dim hght As Integer
Dim dpth As Integer
Dim Tils(wdth, hght) As Tile
Public Property name()
Get
Return named
End Get
Set(ByVal value)
named = value
End Set
End Property
Public Property width()
Get
Return wdth
End Get
Set(ByVal value)
wdth = value
End Set
End Property
Public Property height()
Get
Return hght
End Get
Set(ByVal value)
hght = value
End Set
End Property
Public Property depth()
Get
Return dpth
End Get
Set(ByVal value)
dpth = value
End Set
End Property
Public Property tiles()
Get
For x = 0 To Me.wdth
For y = 0 To Me.hght
'''''''''''''This is where I am getting the trouble, not sure how to handle this...:
Return Tils(x, y).walkable
Return Tils(x, y).image
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Next
Next
End Get
Set(ByVal value)
Tils = value
End Set
End Property
End Class