'''
''' This is the BasicObject class for each Graphics-Component.
'''
Public MustInherit Class BasicObject
#Region "Fields"
Private _Texture As Texture2D
Private _Width As Integer
Private _Height As Integer
Private _Position As Vector2
Private _Visible As Boolean = True
Private _DisposeReady As Boolean = False
#End Region
#Region "Properties"
'''
''' The visual texture of the object.
'''
Public Property Texture As Texture2D
Get
Return _Texture
End Get
Set(value As Texture2D)
_Texture = value
End Set
End Property
'''
''' Height of the object.
'''
Public Property Height As Integer
Get
Return _Height
End Get
Set(value As Integer)
_Height = value
End Set
End Property
'''
''' Width of the object.
'''
Public Property Width As Integer
Get
Return _Width
End Get
Set(value As Integer)
_Width = value
End Set
End Property
'''
''' The position if the object in the window in pixels
'''
Public Property Position As Vector2
Get
Return _Position
End Get
Set(value As Vector2)
_Position = value
End Set
End Property
'''
''' A visible parameter which can be used to toggle object's visibility.
'''
Public Property Visible As Boolean
Get
Return _Visible
End Get
Set(value As Boolean)
_Visible = value
End Set
End Property
'''
''' Shows that you can dispose this object in the next Unload-Method.
'''
Public Property DisposeReady As Boolean
Get
Return _DisposeReady
End Get
Set(value As Boolean)
_DisposeReady = value
End Set
End Property
'''
''' The size of this object (width and height)
'''
Public Property Size As Size
Get
Return New Size(Me.Width, Me.Height)
End Get
Set(value As Size)
Me.Width = value.Width
Me.Height = value.Height
End Set
End Property
#End Region
'''
''' Creates a new instance of this basic calss.
'''
''' The texture for this object.
''' The width of this object (x-axis)
''' The height of this object (y-axis)
''' The position of this object.
Public Sub New(ByVal Texture As Texture2D, ByVal Width As Integer, ByVal Height As Integer, ByVal Position As Vector2)
Me._Texture = Texture
Me._Width = Width
Me._Height = Height
Me._Position = Position
End Sub
End Class