Advertisement
Luciano_fuentes

Carga eventos

Apr 19th, 2017
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Option Explicit
  2.  
  3. '####################################################
  4. 'Autor: Luciano (G Toyz)
  5. 'Creación: 18/04/2017
  6. 'Aclaración: -
  7. 'Ultima modificación:  -
  8. '
  9. '####################################################
  10.  
  11. Private Type tUsuario
  12.     UsuarioIndex As Integer
  13.     Pos As WorldPos
  14. End Type
  15.  
  16. Private Type tEquipos
  17.     Usuarios() As tUsuario
  18.     Rondas As Byte
  19. End Type
  20.  
  21. Private Type tArenas
  22.     EquipoIndex As Byte
  23.     Conteo As Integer
  24.     Pos As WorldPos
  25. End Type
  26.  
  27. Private Type tEsperas
  28.     EquipoIndex As Byte
  29.     Pos As WorldPos
  30. End Type
  31.  
  32. Private Type tManejo
  33.     Oro As Long
  34.     Objetos() As Obj
  35. End Type
  36.  
  37. Public Type tDatosGenerales
  38.     Cupos As Byte
  39.     CaenObjetos As Boolean
  40.     Inscripcion As tManejo
  41.     UsuariosTotales As Byte
  42.     NombreEvento As String
  43. End Type
  44.  
  45. Private Type tGeneral
  46.     Arenas() As tArenas
  47.     Esperas() As tEsperas
  48.     Equipos() As tEquipos
  49.     Datos As tDatosGenerales
  50. End Type
  51.  
  52. Private Eventos() As tGeneral
  53. ''
  54. '
  55. Public Sub Carga()
  56.    
  57. '*********************************************************************************
  58. 'Autor: Luciano (G Toyz)
  59. 'Creación: 18/04/2017
  60. 'Aclaración: -
  61. 'Ultima modificación:  -
  62. '
  63. '*********************************************************************************
  64.    
  65.     Dim Leer As New clsIniReader, cantidadEventos As Byte, LoopC As Long, cantidadArenas As Byte, cantidadEsperas As Byte
  66.            
  67.     Call Leer.Initialize(App.Path & "\Dat\Eventos\INIT.dat")
  68.    
  69.     cantidadEventos = CByte(Leer.GetValue("INIT", "EventosTotales"))
  70.    
  71.     ReDim Eventos(1 To cantidadEventos) As tGeneral
  72.    
  73.     For LoopC = 1 To cantidadEventos
  74.         cantidadArenas = CByte(Leer.GetValue("EVENTO" & LoopC, "ArenasTotales"))
  75.         cantidadEsperas = CByte(Leer.GetValue("EVENTO" & LoopC, "EsperasTotales"))
  76.         With Eventos(LoopC)
  77.             .Datos.UsuariosTotales = CByte(Leer.GetValue("EVENTO" & LoopC, "UsuariosTotales"))
  78.             .Datos.NombreEvento = Leer.GetValue("EVENTO" & LoopC, "NombreEvento")
  79.             Call CargarPosiciones(.Datos.NombreEvento, "Arena", .Arenas.Pos, cantidadArenas)
  80.             Call CargarPosiciones(.Datos.NombreEvento, "Espera", .Esperas.Pos, cantidadEsperas)
  81.         End With
  82.     Next LoopC
  83.    
  84. End Sub
  85.  
  86. Private Sub CargarPosiciones(ByVal NombreEvento As String, ByVal DataFile As String, _
  87.                                                       ByRef Pos As WorldPos, CantidadTotal As Byte)
  88.    
  89. '*********************************************************************************
  90. 'Autor: Luciano (G Toyz)
  91. 'Creación: 18/04/2017
  92. 'Aclaración: -
  93. 'Ultima modificación:  -
  94. '
  95. '*********************************************************************************
  96.    
  97.     Dim Leer As New clsIniReader, LoopC As Long
  98.    
  99.     Call Leer.Initialize(App.Path & "\Dat\Eventos\" & NombreEvento & "\" & DataFile & ".dat")
  100.    
  101.     For LoopC = 1 To CantidadTotal
  102.         Pos.Map = CInt(Leer.GetValue("Espera" & LoopC, "MAPA"))
  103.         Pos.X = CByte(Leer.GetValue("Espera" & LoopC, "X"))
  104.         Pos.Y = CByte(Leer.GetValue("Espera" & LoopC, "Y"))
  105.     Next LoopC
  106.    
  107. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement