Initial commit

This commit is contained in:
Michael J. Seiferling
2015-11-08 16:06:31 -06:00
parent 10be205da1
commit 2fd1aecfc9
87 changed files with 19755 additions and 1 deletions
+291
View File
@@ -0,0 +1,291 @@
Public Class clsGame
Private sGameID As String = Guid.NewGuid.ToString
Private sGameName As String = String.Empty
Private sProcessName As String = String.Empty
Private sPath As String = String.Empty
Private bAbsolutePath As Boolean = False
Private bFolderSave As Boolean = False
Private sFileType As String = String.Empty
Private bAppendTimeStamp As Boolean = False
Private sExcludeList As String = String.Empty
Private sProcessPath As String = String.Empty
Private sIcon As String = String.Empty
Private dHours As Double = 0
Private sVersion As String = String.Empty
Private sCompany As String = String.Empty
Private bEnabled As Boolean = True
Private bMonitorOnly As Boolean = False
Private bDuplicate As Boolean = False
Private sDOSBoxProcess As String = String.Empty
Private bTempGame As Boolean = False
Property ID As String
Set(value As String)
sGameID = value
End Set
Get
Return sGameID
End Get
End Property
ReadOnly Property CroppedName As String
Get
If Name.Length > 40 Then
Return sGameName.Substring(0, 41) & "..."
Else
Return sGameName
End If
End Get
End Property
Property Name As String
Set(value As String)
sGameName = value
End Set
Get
Return sGameName
End Get
End Property
Property ProcessName As String
Set(value As String)
sProcessName = value
End Set
Get
Return sProcessName
End Get
End Property
Property Path As String
Set(value As String)
sPath = mgrPath.ReverseSpecialPaths(value)
End Set
Get
Return mgrPath.ReplaceSpecialPaths(sPath)
End Get
End Property
Property AbsolutePath As Boolean
Set(value As Boolean)
bAbsolutePath = value
End Set
Get
Return bAbsolutePath
End Get
End Property
Property FolderSave As Boolean
Set(value As Boolean)
bFolderSave = value
End Set
Get
Return bFolderSave
End Get
End Property
Property FileType As String
Set(value As String)
sFileType = value
End Set
Get
Return sFileType
End Get
End Property
Property AppendTimeStamp As Boolean
Get
Return bAppendTimeStamp
End Get
Set(value As Boolean)
bAppendTimeStamp = value
End Set
End Property
Property ExcludeList As String
Set(value As String)
sExcludeList = value
End Set
Get
Return sExcludeList
End Get
End Property
Property ProcessPath As String
Set(value As String)
sProcessPath = value
End Set
Get
Return sProcessPath
End Get
End Property
Property Icon As String
Get
Return sIcon
End Get
Set(value As String)
sIcon = value
End Set
End Property
Property Hours As Double
Get
Return dHours
End Get
Set(value As Double)
dHours = value
End Set
End Property
Property Version As String
Get
Return sVersion
End Get
Set(value As String)
sVersion = value
End Set
End Property
Property Company As String
Get
Return sCompany
End Get
Set(value As String)
sCompany = value
End Set
End Property
Property Enabled As Boolean
Set(value As Boolean)
bEnabled = value
End Set
Get
Return bEnabled
End Get
End Property
Property MonitorOnly As Boolean
Set(value As Boolean)
bMonitorOnly = value
End Set
Get
Return bMonitorOnly
End Get
End Property
Property Duplicate As Boolean
Set(value As Boolean)
bDuplicate = value
End Set
Get
Return bDuplicate
End Get
End Property
Property DOSBoxProcess As String
Set(value As String)
sDOSBoxProcess = value
End Set
Get
Return sDOSBoxProcess
End Get
End Property
ReadOnly Property TruePath As String
Get
Return sPath
End Get
End Property
ReadOnly Property TrueProcess As String
Get
Return HandleProcessDuplicates()
End Get
End Property
Property Temporary As Boolean
Get
Return bTempGame
End Get
Set(value As Boolean)
bTempGame = value
End Set
End Property
Public Function SyncEquals(obj As Object) As Boolean
Dim oGame As clsGame = TryCast(obj, clsGame)
If oGame Is Nothing Then
Return False
Else
If Name <> oGame.Name Then
Return False
End If
If ProcessName <> oGame.ProcessName Then
Return False
End If
If Path <> oGame.Path Then
Return False
End If
If FileType <> oGame.FileType Then
Return False
End If
If ExcludeList <> oGame.ExcludeList Then
Return False
End If
If AbsolutePath <> oGame.AbsolutePath Then
Return False
End If
If FolderSave <> oGame.FolderSave Then
Return False
End If
If AppendTimeStamp <> oGame.AppendTimeStamp Then
Return False
End If
If Hours <> oGame.Hours Then
Return False
End If
Return True
End If
End Function
Public Function CoreEquals(obj As Object) As Boolean
Dim oGame As clsGame = TryCast(obj, clsGame)
If oGame Is Nothing Then
Return False
Else
If Name <> oGame.Name Then
Return False
End If
If ProcessName <> oGame.ProcessName Then
Return False
End If
Return True
End If
End Function
Public Function ShallowCopy() As clsGame
Return DirectCast(Me.MemberwiseClone(), clsGame)
End Function
Private Function HandleProcessDuplicates() As String
Dim sProcessName As String
'Handle Duplicates
sProcessName = Me.ProcessName
If Me.Duplicate Then
If Me.ProcessName.Contains("dosbox") Then
If Me.ProcessName.Split(":").Length = 3 Then
sProcessName = Me.ProcessName.Remove(Me.ProcessName.LastIndexOf(":"))
Else
sProcessName = Me.ProcessName
End If
Else
sProcessName = Me.ProcessName.Split(":")(0)
End If
End If
Return sProcessName
End Function
End Class