Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Type CleanWorld
- Map As Integer
- X As Integer
- Y As Integer
- End Type
- Private Const MAX_OBJS_CLEAR As Integer = 100
- Public LastOBJ As Integer
- Public tClearWorld(1 To MAX_OBJS_CLEAR) As CleanWorld
- Public Sub CleanWorld_AddItem(ByVal Map As Integer, ByVal X As Integer, ByVal Y As Integer)
- LastOBJ = LastOBJ + 1
- With tClearWorld(LastOBJ)
- .Map = Map
- .X = X
- .Y = Y
- End With
- If LastOBJ = 100 Then _
- CleanWorld_Clear
- End Sub
- Public Sub CleanWorld_Clear()
- SendData SendTarget.ToAll, 0, PrepareMessageConsoleMsg("Limpieza> Limpiando el mundo.", FontTypeNames.FONTTYPE_TALK)
- SendData SendTarget.ToAll, 0, PrepareMessagePauseToggle
- Dim i As Long
- Dim timeStart As Long
- Dim timeFinish As Long
- Dim tmpString As String
- timeStart = GetTickCount
- For i = 1 To LastOBJ
- With tClearWorld(i)
- If MapData(.Map, .X, .Y).ObjInfo.ObjIndex > 0 Then
- EraseObj 10000, .Map, .X, .Y
- .Map = 0
- .X = 0
- .Y = 0
- End If
- End With
- LastOBJ = 0
- Next i
- timeFinish = GetTickCount - timeStart
- If (timeFinish / 1000) > 0 Then
- tmpString = " Finalizó en " & Round(timeFinish / 1000) & " segundos."
- Else
- tmpString = " Finalizó en " & timeFinish & " milisegundos."
- End If
- SendData SendTarget.ToAll, 0, PrepareMessageConsoleMsg("Limpieza " & tmpString, FontTypeNames.FONTTYPE_TALK)
- SendData SendTarget.ToAll, 0, PrepareMessagePauseToggle
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement