Permalink
Browse files

Removing redundant ByVals (part 4)

  • Loading branch information...
1 parent 1bbeaca commit 38ae200a32dfd4089fc5391d8eca199dd6722522 @Strilanc committed Mar 17, 2011
Showing with 598 additions and 598 deletions.
  1. +9 −9 Plugins/Plugin Interfaces.vb
  2. +6 −6 Plugins/Plugin Manager.vb
  3. +4 −4 Plugins/Plugin Socket.vb
  4. +8 −8 Warcraft3/Download/Download Client.vb
  5. +20 −20 Warcraft3/Download/Download Manager.vb
  6. +6 −6 Warcraft3/Download/Download Transfer.vb
  7. +8 −8 Warcraft3/Download/IPlayerDownloadAspect.vb
  8. +23 −23 Warcraft3/Game/Game Commands.vb
  9. +6 −6 Warcraft3/Game/Game Kernel.vb
  10. +7 −7 Warcraft3/Game/Game Load Screen.vb
  11. +63 −63 Warcraft3/Game/Game Lobby.vb
  12. +23 −23 Warcraft3/Game/Game Motor.vb
  13. +4 −4 Warcraft3/Game/GameLoggerControl.vb
  14. +84 −84 Warcraft3/Game/W3Game.vb
  15. +4 −4 Warcraft3/Game/W3GameControl.vb
  16. +8 −8 Warcraft3/Game/WC3GameManager.vb
  17. +5 −5 Warcraft3/Pinger.vb
  18. +8 −8 Warcraft3/Player/PlayerId.vb
  19. +52 −52 Warcraft3/Player/W3Player.vb
  20. +15 −15 Warcraft3/Protocol/Game Action Protocol.vb
  21. +9 −9 Warcraft3/Protocol/GameAction.vb
  22. +3 −3 Warcraft3/Protocol/GameObjectIdJar.vb
  23. +8 −8 Warcraft3/Protocol/GameStatsJar.vb
  24. +4 −4 Warcraft3/Protocol/ObjectTypeJar.vb
  25. +4 −4 Warcraft3/Protocol/OrderIdJar.vb
  26. +8 −8 Warcraft3/Protocol/PlayerActionSet.vb
  27. +2 −2 Warcraft3/Protocol/SlotJar.vb
  28. +4 −4 Warcraft3/Protocol/WC3 Packet.vb
  29. +72 −72 Warcraft3/Protocol/WC3 Protocol Packers.vb
  30. +14 −14 Warcraft3/Protocol/WC3 Protocol Values.vb
  31. +9 −9 Warcraft3/Protocol/WC3 Protocol.vb
  32. +29 −29 Warcraft3/Replay/Replay Entry Packers.vb
  33. +8 −8 Warcraft3/Replay/Replay Format.vb
  34. +16 −16 Warcraft3/Replay/ReplayDataReader.vb
  35. +9 −9 Warcraft3/Replay/ReplayEntry.vb
  36. +17 −17 Warcraft3/Replay/ReplayManager.vb
  37. +11 −11 Warcraft3/Replay/ReplayReader.vb
  38. +8 −8 Warcraft3/Replay/ReplayWriter.vb
@@ -2,7 +2,7 @@ Namespace Plugins
<Serializable()>
Public NotInheritable Class PluginException
Inherits Exception
- Public Sub New(ByVal message As String, Optional ByVal innerException As Exception = Nothing)
+ Public Sub New(message As String, Optional innerException As Exception = Nothing)
MyBase.New(message, innerException)
End Sub
End Class
@@ -14,9 +14,9 @@ Namespace Plugins
ReadOnly Property Logger As Logger
ReadOnly Property HasControl As Boolean
ReadOnly Property Control() As Control
- Function InvokeCommand(ByVal user As BotUser, ByVal argument As String) As Task(Of String)
- Function IsArgumentPrivate(ByVal argument As String) As Boolean
- Function IncludeCommand(ByVal command As Commands.ICommand(Of IPlugin)) As Task(Of IDisposable)
+ Function InvokeCommand(user As BotUser, argument As String) As Task(Of String)
+ Function IsArgumentPrivate(argument As String) As Boolean
+ Function IncludeCommand(command As Commands.ICommand(Of IPlugin)) As Task(Of IDisposable)
<ContractClassFor(GetType(IPlugin))>
MustInherit Shadows Class ContractClass
@@ -47,12 +47,12 @@ Namespace Plugins
Throw New NotSupportedException
End Get
End Property
- Public Function InvokeCommand(ByVal user As BotUser, ByVal argument As String) As Task(Of String) Implements IPlugin.InvokeCommand
+ Public Function InvokeCommand(user As BotUser, argument As String) As Task(Of String) Implements IPlugin.InvokeCommand
Contract.Requires(argument IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task(Of String))() IsNot Nothing)
Throw New NotSupportedException
End Function
- Public Function IsArgumentPrivate(ByVal argument As String) As Boolean Implements IPlugin.IsArgumentPrivate
+ Public Function IsArgumentPrivate(argument As String) As Boolean Implements IPlugin.IsArgumentPrivate
Contract.Requires(argument IsNot Nothing)
Throw New NotSupportedException
End Function
@@ -61,7 +61,7 @@ Namespace Plugins
Throw New NotSupportedException
End Get
End Property
- Public Function IncludeCommand(ByVal command As Commands.ICommand(Of IPlugin)) As Task(Of IDisposable) Implements IPlugin.IncludeCommand
+ Public Function IncludeCommand(command As Commands.ICommand(Of IPlugin)) As Task(Of IDisposable) Implements IPlugin.IncludeCommand
Contract.Requires(command IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task(Of IDisposable))() IsNot Nothing)
Throw New NotSupportedException
@@ -71,13 +71,13 @@ Namespace Plugins
<ContractClass(GetType(IPluginFactory.ContractClass))>
Public Interface IPluginFactory
- Function CreatePlugin(ByVal bot As Bot.MainBot) As IPlugin
+ Function CreatePlugin(bot As Bot.MainBot) As IPlugin
<ContractClassFor(GetType(IPluginFactory))>
MustInherit Class ContractClass
Implements IPluginFactory
- Public Function CreatePlugin(ByVal bot As Bot.MainBot) As IPlugin Implements IPluginFactory.CreatePlugin
+ Public Function CreatePlugin(bot As Bot.MainBot) As IPlugin Implements IPluginFactory.CreatePlugin
Contract.Requires(bot IsNot Nothing)
Contract.Ensures(Contract.Result(Of IPlugin)() IsNot Nothing)
Throw New NotSupportedException()
View
@@ -16,7 +16,7 @@ Namespace Plugins
Contract.Invariant(_hooks IsNot Nothing)
End Sub
- Public Sub New(ByVal socket As Plugins.Socket)
+ Public Sub New(socket As Plugins.Socket)
Contract.Requires(socket IsNot Nothing)
Me._socket = socket
End Sub
@@ -42,14 +42,14 @@ Namespace Plugins
Return _socket.Plugin.HasControl
End Get
End Property
- Public Function IsArgumentPrivate(ByVal argument As String) As Boolean Implements IBotComponent.IsArgumentPrivate
+ Public Function IsArgumentPrivate(argument As String) As Boolean Implements IBotComponent.IsArgumentPrivate
Return _socket.Plugin.IsArgumentPrivate(argument)
End Function
- Public Function InvokeCommand(ByVal user As BotUser, ByVal argument As String) As Task(Of String) Implements IBotComponent.InvokeCommand
+ Public Function InvokeCommand(user As BotUser, argument As String) As Task(Of String) Implements IBotComponent.InvokeCommand
Return _socket.Plugin.InvokeCommand(user, argument)
End Function
- Protected Overrides Function PerformDispose(ByVal finalizing As Boolean) As Task
+ Protected Overrides Function PerformDispose(finalizing As Boolean) As Task
_socket.Dispose()
Return _hooks.DisposeAllAsync()
End Function
@@ -60,7 +60,7 @@ Namespace Plugins
End Get
End Property
- Private Function IncludeCommandImpl(ByVal command As ICommand(Of IBotComponent)) As Task(Of IDisposable) Implements IBotComponent.IncludeCommand
+ Private Function IncludeCommandImpl(command As ICommand(Of IBotComponent)) As Task(Of IDisposable) Implements IBotComponent.IncludeCommand
Dim converter = Function(plugin As IPlugin)
If plugin IsNot Me._socket.Plugin Then
Throw New NotSupportedException("Command mapped from manager to plugin used on different plugin.")
@@ -69,7 +69,7 @@ Namespace Plugins
End Function
Return IncludeCommand(command.ProjectedFrom(converter))
End Function
- Public Function IncludeCommand(ByVal command As ICommand(Of IPlugin)) As Task(Of IDisposable)
+ Public Function IncludeCommand(command As ICommand(Of IPlugin)) As Task(Of IDisposable)
Contract.Requires(command IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task(Of IDisposable))() IsNot Nothing)
Return _socket.Plugin.IncludeCommand(command)
View
@@ -12,9 +12,9 @@ Namespace Plugins
End Sub
<CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId:="System.Reflection.Assembly.LoadFrom")>
- Public Sub New(ByVal name As InvariantString,
- ByVal bot As Bot.MainBot,
- ByVal assemblyPath As String)
+ Public Sub New(name As InvariantString,
+ bot As Bot.MainBot,
+ assemblyPath As String)
Contract.Requires(bot IsNot Nothing)
Contract.Requires(assemblyPath IsNot Nothing)
Me._name = name
@@ -42,7 +42,7 @@ Namespace Plugins
End Get
End Property
- Protected Overrides Function PerformDispose(ByVal finalizing As Boolean) As Task
+ Protected Overrides Function PerformDispose(finalizing As Boolean) As Task
_plugin.Dispose()
Return Nothing
End Function
@@ -35,10 +35,10 @@ Namespace WC3.Download
Contract.Invariant(_reportedPosition <= _map.FileSize)
End Sub
- Public Sub New(ByVal player As IPlayerDownloadAspect,
- ByVal map As Map,
- ByVal clock As IClock,
- ByVal hooks As IEnumerable(Of Task(Of IDisposable)))
+ Public Sub New(player As IPlayerDownloadAspect,
+ map As Map,
+ clock As IClock,
+ hooks As IEnumerable(Of Task(Of IDisposable)))
Contract.Requires(map IsNot Nothing)
Contract.Requires(clock IsNot Nothing)
Contract.Requires(hooks IsNot Nothing)
@@ -123,7 +123,7 @@ Namespace WC3.Download
Contract.Requires(HasReported)
Return _reportedState
End Get
- Set(ByVal value As Protocol.MapTransferState)
+ Set(value As Protocol.MapTransferState)
Contract.Requires(HasReported)
_reportedState = value
End Set
@@ -135,7 +135,7 @@ Namespace WC3.Download
Contract.Assume(_reportedPosition <= Map.FileSize)
Return _reportedPosition
End Get
- Set(ByVal value As UInt32)
+ Set(value As UInt32)
Contract.Requires(HasReported)
Contract.Requires(value <= Map.FileSize)
Contract.Assume(value <= _map.FileSize)
@@ -184,7 +184,7 @@ Namespace WC3.Download
Where sign <> 0).FirstOrDefault)
End Function
- Public Shared Function StartTransfer(ByVal downloader As TransferClient, ByVal uploader As TransferClient) As Transfer
+ Public Shared Function StartTransfer(downloader As TransferClient, uploader As TransferClient) As Transfer
Contract.Requires(downloader IsNot Nothing)
Contract.Requires(uploader IsNot Nothing)
Contract.Requires(downloader.HasReported)
@@ -234,7 +234,7 @@ Namespace WC3.Download
_hasReported = True
End Sub
- Protected Overrides Function PerformDispose(ByVal finalizing As Boolean) As Task
+ Protected Overrides Function PerformDispose(finalizing As Boolean) As Task
If _transfer IsNot Nothing Then
_transfer.Dispose()
_transfer = Nothing
@@ -36,11 +36,11 @@ Namespace WC3.Download
'Contract.Invariant((_started.State = OnetimeLockState.Acquired) = (_mapPieceSender IsNot Nothing))
End Sub
- Public Sub New(ByVal clock As IClock,
- ByVal map As Map,
- ByVal logger As Logger,
- ByVal allowDownloads As Boolean,
- ByVal allowUploads As Boolean)
+ Public Sub New(clock As IClock,
+ map As Map,
+ logger As Logger,
+ allowDownloads As Boolean,
+ allowUploads As Boolean)
Contract.Requires(map IsNot Nothing)
Contract.Requires(logger IsNot Nothing)
Contract.Requires(clock IsNot Nothing)
@@ -51,8 +51,8 @@ Namespace WC3.Download
Me._allowUploads = allowUploads
End Sub
- Public Sub Start(ByVal startPlayerHoldPoint As IHoldPoint(Of IPlayerDownloadAspect),
- ByVal mapPieceSender As Action(Of IPlayerDownloadAspect, UInt32))
+ Public Sub Start(startPlayerHoldPoint As IHoldPoint(Of IPlayerDownloadAspect),
+ mapPieceSender As Action(Of IPlayerDownloadAspect, UInt32))
Contract.Requires(startPlayerHoldPoint IsNot Nothing)
Contract.Requires(mapPieceSender IsNot Nothing)
If Me.IsDisposed Then Throw New ObjectDisposedException(Me.GetType.Name)
@@ -80,7 +80,7 @@ Namespace WC3.Download
End Get
End Property
- Private Sub SendMapFileData(ByVal client As TransferClient, ByVal reportedPosition As UInt32)
+ Private Sub SendMapFileData(client As TransferClient, reportedPosition As UInt32)
Contract.Requires(client IsNot Nothing)
Contract.Requires(client.Transfer IsNot Nothing)
Contract.Requires(client.Transfer.Uploader Is _defaultClient)
@@ -94,7 +94,7 @@ Namespace WC3.Download
End Sub
#Region "Public View"
- Private ReadOnly Property ClientLatencyDescription(ByVal player As IPlayerDownloadAspect, ByVal latencyDescription As String) As String
+ Private ReadOnly Property ClientLatencyDescription(player As IPlayerDownloadAspect, latencyDescription As String) As String
Get
Contract.Requires(player IsNot Nothing)
Contract.Requires(latencyDescription IsNot Nothing)
@@ -119,14 +119,14 @@ Namespace WC3.Download
End If
End Get
End Property
- Public Function QueueGetClientLatencyDescription(ByVal player As IPlayerDownloadAspect, ByVal latencyDescription As String) As Task(Of String)
+ Public Function QueueGetClientLatencyDescription(player As IPlayerDownloadAspect, latencyDescription As String) As Task(Of String)
Contract.Requires(player IsNot Nothing)
Contract.Requires(latencyDescription IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task(Of String))() IsNot Nothing)
Return inQueue.QueueFunc(Function() ClientLatencyDescription(player, latencyDescription))
End Function
- Private ReadOnly Property ClientBandwidthDescription(ByVal player As IPlayerDownloadAspect) As String
+ Private ReadOnly Property ClientBandwidthDescription(player As IPlayerDownloadAspect) As String
Get
Contract.Requires(player IsNot Nothing)
Contract.Ensures(Contract.Result(Of String)() IsNot Nothing)
@@ -147,7 +147,7 @@ Namespace WC3.Download
Return ">HiB/s" '... What? It could happen...
End Get
End Property
- Public Function QueueGetClientBandwidthDescription(ByVal player As IPlayerDownloadAspect) As Task(Of String)
+ Public Function QueueGetClientBandwidthDescription(player As IPlayerDownloadAspect) As Task(Of String)
Contract.Requires(player IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task(Of String))() IsNot Nothing)
Return inQueue.QueueFunc(Function() ClientBandwidthDescription(player))
@@ -161,7 +161,7 @@ Namespace WC3.Download
#End Region
#Region "Game-Triggered"
- Private Function OnGameStartPlayerHold(ByVal player As IPlayerDownloadAspect) As Task
+ Private Function OnGameStartPlayerHold(player As IPlayerDownloadAspect) As Task
Contract.Requires(player IsNot Nothing)
Dim playerHooks = New List(Of Task(Of IDisposable))() From {
@@ -187,22 +187,22 @@ Namespace WC3.Download
#End Region
#Region "Communication-Triggered"
- Private Function QueueOnReceiveClientMapInfo(ByVal player As IPlayerDownloadAspect, ByVal vals As NamedValueMap) As Task
+ Private Function QueueOnReceiveClientMapInfo(player As IPlayerDownloadAspect, vals As NamedValueMap) As Task
Contract.Requires(player IsNot Nothing)
Contract.Requires(vals IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return inQueue.QueueAction(Sub() OnReceiveClientMapInfo(player:=player,
state:=vals.ItemAs(Of Protocol.MapTransferState)("transfer state"),
position:=vals.ItemAs(Of UInt32)("total downloaded")))
End Function
- Private Function QueueOnReceivePeerConnectionInfo(ByVal player As IPlayerDownloadAspect, ByVal flags As UInt16) As Task
+ Private Function QueueOnReceivePeerConnectionInfo(player As IPlayerDownloadAspect, flags As UInt16) As Task
Contract.Requires(player IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return inQueue.QueueAction(Sub() OnReceivePeerConnectionInfo(player:=player,
flags:=flags))
End Function
- Private Sub OnReceivePeerConnectionInfo(ByVal player As IPlayerDownloadAspect, ByVal flags As UInt32)
+ Private Sub OnReceivePeerConnectionInfo(player As IPlayerDownloadAspect, flags As UInt32)
Contract.Requires(player IsNot Nothing)
If Not _playerClients.ContainsKey(player) Then Return
@@ -216,7 +216,7 @@ Namespace WC3.Download
Select peer)
End Sub
- Private Sub OnReceiveClientMapInfo(ByVal player As IPlayerDownloadAspect, ByVal state As Protocol.MapTransferState, ByVal position As UInt32)
+ Private Sub OnReceiveClientMapInfo(player As IPlayerDownloadAspect, state As Protocol.MapTransferState, position As UInt32)
Contract.Requires(player IsNot Nothing)
If Not _playerClients.ContainsKey(player) Then Return
@@ -243,7 +243,7 @@ Namespace WC3.Download
SendMapFileData(client, position)
End If
End Sub
- Private Sub OnFirstMapInfo(ByVal client As TransferClient, ByVal state As Protocol.MapTransferState, ByVal position As UInt32)
+ Private Sub OnFirstMapInfo(client As TransferClient, state As Protocol.MapTransferState, position As UInt32)
Contract.Requires(client IsNot Nothing)
Contract.Requires(client.Player IsNot Nothing)
Contract.Requires(Not client.HasReported)
@@ -258,7 +258,7 @@ Namespace WC3.Download
reasonDescription:="Downloads not allowed.")
End If
End Sub
- Private Sub OnTypicalMapInfo(ByVal client As TransferClient, ByVal state As Protocol.MapTransferState, ByVal position As UInt32)
+ Private Sub OnTypicalMapInfo(client As TransferClient, state As Protocol.MapTransferState, position As UInt32)
Contract.Requires(client IsNot Nothing)
Contract.Requires(client.Player IsNot Nothing)
Contract.Requires(client.HasReported)
@@ -391,7 +391,7 @@ Namespace WC3.Download
End Sub
#End Region
- Protected Overrides Function PerformDispose(ByVal finalizing As Boolean) As Task
+ Protected Overrides Function PerformDispose(finalizing As Boolean) As Task
If finalizing Then Return Nothing
Return inQueue.QueueFunc(
Function()
@@ -20,11 +20,11 @@ Namespace WC3.Download
Contract.Invariant(_startingPosition <= _fileSize)
End Sub
- Public Sub New(ByVal downloader As TransferClient,
- ByVal uploader As TransferClient,
- ByVal startingPosition As UInt32,
- ByVal filesize As UInt32,
- ByVal clock As IClock)
+ Public Sub New(downloader As TransferClient,
+ uploader As TransferClient,
+ startingPosition As UInt32,
+ filesize As UInt32,
+ clock As IClock)
Contract.Requires(downloader IsNot Nothing)
Contract.Requires(uploader IsNot Nothing)
Contract.Requires(clock IsNot Nothing)
@@ -95,7 +95,7 @@ Namespace WC3.Download
End Get
End Property
- Public Sub Advance(ByVal progress As UInt32)
+ Public Sub Advance(progress As UInt32)
_totalProgress += progress
_lastActivityClock = _lastActivityClock.Restarted()
End Sub
Oops, something went wrong.

0 comments on commit 38ae200

Please sign in to comment.