Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create ItemActions. Move JunkItem from MapActions to ItemActions.
- Loading branch information
1 parent
06e6c29
commit 4491547
Showing
3 changed files
with
36 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using AutomaticTypeMapper; | ||
using EOLib.Domain.Map; | ||
using EOLib.Net; | ||
using EOLib.Net.Communication; | ||
|
||
namespace EOLib.Domain.Item | ||
{ | ||
[AutoMappedType] | ||
public class ItemActions : IItemActions | ||
{ | ||
private readonly IPacketSendService _packetSendService; | ||
|
||
public ItemActions(IPacketSendService packetSendService) | ||
{ | ||
_packetSendService = packetSendService; | ||
} | ||
|
||
public void JunkItem(IItem item) | ||
{ | ||
var packet = new PacketBuilder(PacketFamily.Item, PacketAction.Junk) | ||
.AddShort(item.ItemID) | ||
.AddInt(item.Amount) | ||
.Build(); | ||
|
||
_packetSendService.SendPacket(packet); | ||
} | ||
} | ||
|
||
public interface IItemActions | ||
{ | ||
void JunkItem(IItem item); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters