public void Execute(GameState state, ConfigRoot config, ICommandBuffer buffer) { state.Level.MovedUnits.Add(DealerId); var damage = DamageLogic.GetDamage(state, config, DealerId, TargetId); var target = state.Level.FindUnitById(TargetId); target.Health -= damage; if (target.Health <= 0) { buffer.Add(new KillUnitCommand(target.Id)); } }