public void Execute(GameSession gameSession, IByteBuffer buffer) { var request = new SelectBatteryRequest(); request.readCommand(buffer); var batteryLootId = AmmoConvertManager.AmmoTypeToString(request.batteryType.type); gameSession.Player.Settings.GetSettings <SlotbarSettings>().SelectedLaserAmmo = batteryLootId; gameSession.Player.Settings.SaveSettings(); gameSession.Player.OnLaserAmmoChange(batteryLootId); }
public void execute(GameSession gameSession, byte[] bytes) { var read = new SelectBatteryRequest(); read.readCommand(bytes); var player = gameSession.Player; var settingsManager = player.SettingsManager; var newSelectedLaser = read.batteryType.typeValue; settingsManager.SelectedLaser = newSelectedLaser; player.AttackManager.LaserAttack(); player.Settings.ShipSettings.selectedLaser = newSelectedLaser; }